use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class Space3DUtilsTest method testTransform1MUp.
@Test
public void testTransform1MUp() {
Leg up1MLeg = new Leg(1, 0, 90);
Coord3D result = Space3DUtils.toCartesian(Coord3D.ORIGIN, up1MLeg);
Coord3D expected = new Coord3D(0, 0, 1);
assertEquals(expected, result);
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class Space3DUtilsTest method testTransform1MDown.
@Test
public void testTransform1MDown() {
Leg up1MLeg = new Leg(1, 0, -90);
Coord3D result = Space3DUtils.toCartesian(Coord3D.ORIGIN, up1MLeg);
Coord3D expected = new Coord3D(0, 0, -1);
assertEquals(expected, result);
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class Space3DUtilsTest method testTransform3N3E3S3W.
@Test
public void testTransform3N3E3S3W() {
Leg n3 = new Leg(3, 0, 0);
Coord3D result = Space3DUtils.toCartesian(Coord3D.ORIGIN, n3);
Leg e3 = new Leg(3, 90, 0);
result = Space3DUtils.toCartesian(result, e3);
Leg s3 = new Leg(3, 180, 0);
result = Space3DUtils.toCartesian(result, s3);
Leg w3 = new Leg(3, 270, 0);
result = Space3DUtils.toCartesian(result, w3);
assertEquals(Coord3D.ORIGIN, result);
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class StationRenameTest method testBacksights.
@Test
public void testBacksights() {
Leg fore1 = new Leg(10, 180, +42);
Leg back1 = new Leg(10, 0, -42);
Assert.assertTrue("Legs should be perfectly-equal backsights", SurveyUpdater.areLegsBacksights(fore1, back1));
Leg back2 = new Leg(15, 90, 0);
Assert.assertFalse("Legs should not be considered backsights for each other", SurveyUpdater.areLegsBacksights(fore1, back2));
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class SurveyUpdaterTest method testEditLegWorks.
@Test
public void testEditLegWorks() {
Leg leg = new Leg(5, 0, 0);
Survey survey = new Survey("Test Survey");
SurveyUpdater.update(survey, leg);
Leg newEdit = new Leg(6, 0, 0);
SurveyUpdater.editLeg(survey, leg, newEdit);
Assert.assertEquals(survey.getAllLegs().size(), 1);
Assert.assertEquals(survey.getAllLegs().get(0).getDistance(), 6, ALLOWED_DOUBLE_DELTA);
}
Aggregations