Search in sources :

Example 1 with ElevationAngle

use of org.apache.sis.measure.ElevationAngle in project sis by apache.

the class CoordinateSystemsTest method assertAngleEquals.

/**
 * Asserts that the angle between the given directions is equals to the given value.
 * This method tests also the angle by interchanging the given directions.
 */
private static void assertAngleEquals(final boolean isElevation, final double expected, final AxisDirection source, final AxisDirection target) {
    final Angle forward = angle(source, target);
    final Angle inverse = angle(target, source);
    assertEquals(isElevation, forward instanceof ElevationAngle);
    assertEquals(isElevation, inverse instanceof ElevationAngle);
    assertEquals(+expected, (forward != null) ? forward.degrees() : Double.NaN, STRICT);
    assertEquals(-expected, (inverse != null) ? inverse.degrees() : Double.NaN, STRICT);
}
Also used : ElevationAngle(org.apache.sis.measure.ElevationAngle) Angle(org.apache.sis.measure.Angle) ElevationAngle(org.apache.sis.measure.ElevationAngle)

Aggregations

Angle (org.apache.sis.measure.Angle)1 ElevationAngle (org.apache.sis.measure.ElevationAngle)1