Added javadoc to classes.

#story[1097]
This commit is contained in:
zwu18
2017-08-12 02:11:23 +12:00
parent 03713d3699
commit 9c902dab46
2 changed files with 18 additions and 2 deletions
@@ -6,12 +6,17 @@ import mock.model.VMG;
import shared.model.Bearing;
/**
* Created by David on 2/08/2017.
* Command class for tacking and gybing
*/
public class TackGybeCommand implements Command {
private MockRace race;
private MockBoat boat;
/**
* Constructor for class
* @param race mock race
* @param boat mock boat to update
*/
public TackGybeCommand(MockRace race, MockBoat boat) {
this.race = race;
this.boat = boat;
@@ -39,6 +44,12 @@ public class TackGybeCommand implements Command {
}
}
/**
* Method to calculate smallest angle between 2 angles
* @param degreeA first angle degree
* @param degreeB second angle degree
* @return the calculated smallest angle
*/
public double calcDistance(double degreeA, double degreeB){
double phi = Math.abs(degreeB - degreeA) % 360;
double distance = phi > 180 ? 360 - phi : phi;