Tests for curve calculation
This commit is contained in:
parent
4614b1f7bc
commit
e0cc0bc60b
@ -88,6 +88,7 @@ public fun GeoEllipsoid.parallelCurve(latitude: Angle, fromLongitude: Angle, toL
|
||||
* @param start starting location
|
||||
* @return solution to the direct geodetic problem
|
||||
*/
|
||||
@Suppress("SpellCheckingInspection", "LocalVariableName")
|
||||
public fun GeoEllipsoid.curveInDirection(
|
||||
start: GmcPose,
|
||||
distance: Distance,
|
||||
@ -210,6 +211,7 @@ public fun GeoEllipsoid.curveInDirection(
|
||||
* @param end ending coordinates
|
||||
* @return solution to the inverse geodetic problem
|
||||
*/
|
||||
@Suppress("SpellCheckingInspection", "LocalVariableName")
|
||||
public fun GeoEllipsoid.curveBetween(start: GMC, end: GMC, precision: Double = 1e-6): GmcCurve {
|
||||
//
|
||||
// All equation numbers refer back to Vincenty's publication:
|
||||
|
@ -27,11 +27,19 @@ internal class DistanceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun largeDistance() {
|
||||
fun curveBetween() {
|
||||
val curve = GeoEllipsoid.WGS84.curveBetween(moscow, spb)
|
||||
val distance = curve.distance
|
||||
|
||||
assertEquals(632.035426877, distance.kilometers, 0.1)
|
||||
assertEquals(632.035426877, distance.kilometers, 0.0001)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun curveInDirection() {
|
||||
val curve = GeoEllipsoid.WGS84.curveInDirection(
|
||||
GmcPose(moscow, (-0.6947937116552751).radians), Distance(632.035426877)
|
||||
)
|
||||
|
||||
assertEquals(spb.latitude.radians.value,curve.backward.latitude.radians.value, 0.0001)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user