internal GeodeticMeasurement CalculateGeodeticMeasurement(Ellipsoid refEllipsoid, GlobalPosition start, GlobalPosition end, double tolerance) { // get the coordinates GlobalCoordinates startCoords = start.Coordinates; GlobalCoordinates endCoords = end.Coordinates; // calculate elevation differences double elev1 = start.ElevationMeters; double elev2 = end.ElevationMeters; double elev12 = (elev1 + elev2) / 2.0; double phi1 = startCoords.Latitude.Radians; double phi2 = endCoords.Latitude.Radians; double phi12 = (phi1 + phi2) / 2.0; double refA = refEllipsoid.SemiMajorAxisMeters; double f = refEllipsoid.Flattening; double a = refA + elev12 * (1.0 + f * Math.Sin(phi12)); Ellipsoid ellipsoid = Ellipsoid.FromAAndF(a, f); GeodeticCurve averageCurve = CalculateGeodeticCurve(ellipsoid, startCoords, endCoords, tolerance); return(new GeodeticMeasurement(averageCurve, elev2 - elev1)); }
public GeodeticMeasurement CalculateGeodeticMeasurement(Ellipsoid refEllipsoid, GlobalPosition start, GlobalPosition end) => this.CalculateGeodeticMeasurement(refEllipsoid, start, end, StandardTolerance);