|
|
|
|
@ -145,8 +145,6 @@ public class NewPolars {
|
|
|
|
|
* @return the best vmg that the boat can change to
|
|
|
|
|
*/
|
|
|
|
|
public static VMG setBestVMG(Bearing trueWindAngle, double trueWindSpeed, Bearing boatAngle){
|
|
|
|
|
//System.out.println("VMG AUTO CALLED");
|
|
|
|
|
//speed
|
|
|
|
|
double closestSpeed = getClosest(trueWindSpeed, polars.keySet());
|
|
|
|
|
|
|
|
|
|
double angle = modulateAngle(boatAngle.degrees() - trueWindAngle.degrees());
|
|
|
|
|
@ -184,21 +182,4 @@ public class NewPolars {
|
|
|
|
|
public static double modulateAngle(double angle){
|
|
|
|
|
return (angle % 360 + 360) % 360;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Double, TreeMap<Double, Double>> getPolars(){
|
|
|
|
|
//this function is just for testing so therefore it is private
|
|
|
|
|
return polars;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void printOutLinearInterpolated(){
|
|
|
|
|
for (double tws: polars.keySet()){
|
|
|
|
|
System.out.println("==================================================");
|
|
|
|
|
System.out.println("Speed: " + tws);
|
|
|
|
|
System.out.println("==================================================");
|
|
|
|
|
for (double twa: polars.get(tws).keySet()){
|
|
|
|
|
System.out.println("TWA: " + twa + ", Boat Speed: " + polars.get(tws).get(twa));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|