Boat moves between legs and finishes

- Have hard coded in first two legs
-Possibly found problem with lat and longitude coordinate system being switched
#story[9]
This commit is contained in:
Erika
2017-03-19 14:14:53 +13:00
parent 8ae540a6b9
commit 192178760e
8 changed files with 78 additions and 36 deletions
@@ -4,6 +4,8 @@ package seng302.Model;
import org.junit.Test;
import seng302.GPSCoordinate;
import static org.junit.Assert.assertEquals;
/**
* Created by esa46 on 16/03/17.
*/
@@ -12,7 +14,8 @@ public class ConstantVelocityRaceTest {
@Test
public void travelling5nmNorthGivesCorrectNewCoordinates() {
GPSCoordinate oldPos = new GPSCoordinate(0, 0);
System.out.println(ConstantVelocityRace.calculatePosition(oldPos, 18520, 90).getLatitude());
System.out.println(ConstantVelocityRace.calculatePosition(oldPos, 18520, 90).getLongitude());
System.out.println(ConstantVelocityRace.calculatePosition(oldPos, 5, 0).getLatitude());
// assertEquals(ConstantVelocityRace.calculatePosition(oldPos, 5, 90).getLatitude(), 0.08, 1e-1);
System.out.println(ConstantVelocityRace.calculatePosition(oldPos, 5, 0).getLongitude());
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ public class RaceTest {
BoatInRace boat = new BoatInRace("NZ", 240);
BoatInRace[] boats = new BoatInRace[] {boat};
ArrayList<Leg> legs = new ArrayList<>();
legs.add(new Leg("Start", 1, new GPSCoordinate(0,0), new GPSCoordinate(1,1), 0));
legs.add(new Leg("Start", new GPSCoordinate(0,0), new GPSCoordinate(1,1), 0));
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs);
race.run();
}