removed the get best heading method as it was incorrect and not related to this story
#story[900]
This commit is contained in:
@@ -132,34 +132,6 @@ public class Polar {
|
||||
this.trueWindAngles.add(option7);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angleToDestination
|
||||
* @param angleOfWind
|
||||
* @return
|
||||
*/
|
||||
public double getBestHeading(double angleToDestination, double angleOfWind){
|
||||
double vmg = 0;
|
||||
double vmgTemp = 0;
|
||||
|
||||
double[] bestOption = null;
|
||||
|
||||
for(double[] option: this.trueWindAngles) {
|
||||
double angle = option[0] - angleToDestination;
|
||||
vmgTemp = cos(angle)*option[1];
|
||||
|
||||
if(bestOption == null){
|
||||
vmg = vmgTemp;
|
||||
bestOption = option;
|
||||
}else if (vmgTemp > vmg){
|
||||
vmg = vmgTemp;
|
||||
bestOption = option;
|
||||
}
|
||||
}
|
||||
|
||||
return bestOption[0];
|
||||
}
|
||||
|
||||
public Integer getTrueWindSpeed() {
|
||||
return trueWindSpeed;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package seng302.Model;
|
||||
|
||||
/**
|
||||
* Created by hba56 on 10/05/17.
|
||||
*/
|
||||
public class PolarTest {
|
||||
}
|
||||
Reference in New Issue
Block a user