use of org.orekit.models.earth.tessellation.Tile in project Orekit by CS-SI.
the class TileTest method testCenteredSquare.
@Test
public void testCenteredSquare() {
double angle = 0.25;
GeodeticPoint v0 = new GeodeticPoint(-angle, -angle, 100.0);
GeodeticPoint v1 = new GeodeticPoint(-angle, +angle, 100.0);
GeodeticPoint v2 = new GeodeticPoint(+angle, -angle, 100.0);
GeodeticPoint v3 = new GeodeticPoint(+angle, +angle, 100.0);
Tile tile = new Tile(v0, v1, v2, v3);
assertThat(tile.getVertices()[0], geodeticPointCloseTo(v0, 1.0e-9));
assertThat(tile.getVertices()[1], geodeticPointCloseTo(v1, 1.0e-9));
assertThat(tile.getVertices()[2], geodeticPointCloseTo(v2, 1.0e-9));
assertThat(tile.getVertices()[3], geodeticPointCloseTo(v3, 1.0e-9));
assertThat(tile.getVertices()[3], geodeticPointCloseTo(v3, 1.0e-9));
assertThat(tile.getInterpolatedPoint(0, 0), geodeticPointCloseTo(v0, 1.0e-9));
assertThat(tile.getInterpolatedPoint(1, 0), geodeticPointCloseTo(v1, 1.0e-9));
assertThat(tile.getInterpolatedPoint(1, 1), geodeticPointCloseTo(v2, 1.0e-9));
assertThat(tile.getInterpolatedPoint(0, 1), geodeticPointCloseTo(v3, 1.0e-9));
assertThat(tile.getCenter(), geodeticPointCloseTo(new GeodeticPoint(0.0, 0.0, 100.0), 1.0e-9));
}
use of org.orekit.models.earth.tessellation.Tile in project Orekit by CS-SI.
the class TileTest method testPoleCentered.
@Test
public void testPoleCentered() {
double latitude = 0.25;
GeodeticPoint v0 = new GeodeticPoint(latitude, 0.0 * FastMath.PI, 100.0);
GeodeticPoint v1 = new GeodeticPoint(latitude, 0.5 * FastMath.PI, 200.0);
GeodeticPoint v2 = new GeodeticPoint(latitude, 1.0 * FastMath.PI, 300.0);
GeodeticPoint v3 = new GeodeticPoint(latitude, 1.5 * FastMath.PI, 200.0);
Tile tile = new Tile(v0, v1, v2, v3);
assertThat(tile.getVertices()[0], geodeticPointCloseTo(v0, 1.0e-9));
assertThat(tile.getVertices()[1], geodeticPointCloseTo(v1, 1.0e-9));
assertThat(tile.getVertices()[2], geodeticPointCloseTo(v2, 1.0e-9));
assertThat(tile.getVertices()[3], geodeticPointCloseTo(v3, 1.0e-9));
assertThat(tile.getVertices()[3], geodeticPointCloseTo(v3, 1.0e-9));
assertThat(tile.getInterpolatedPoint(0, 0), geodeticPointCloseTo(v0, 1.0e-9));
assertThat(tile.getInterpolatedPoint(1, 0), geodeticPointCloseTo(v1, 1.0e-9));
assertThat(tile.getInterpolatedPoint(1, 1), geodeticPointCloseTo(v2, 1.0e-9));
assertThat(tile.getInterpolatedPoint(0, 1), geodeticPointCloseTo(v3, 1.0e-9));
Assert.assertEquals(0.5 * FastMath.PI, tile.getCenter().getLatitude(), 1.0e-9);
}
Aggregations