Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
NETGeographicLib::Geodesic Class Reference

.NET wrapper for GeographicLib::Geodesic. More...

#include <Geodesic.h>

Public Types

enum  mask {
  mask::NONE, mask::LATITUDE, mask::LONGITUDE, mask::AZIMUTH,
  mask::DISTANCE, mask::DISTANCE_IN, mask::REDUCEDLENGTH, mask::GEODESICSCALE,
  mask::AREA, mask::LONG_UNROLL, mask::ALL
}
 

Public Member Functions

 ~Geodesic ()
 the destructor calls the finalizer. More...
 
Constructor
 Geodesic (double a, double f)
 
 Geodesic ()
 
Direct geodesic problem specified in terms of distance.
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
 
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2)
 
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2)
 
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12)
 
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
double Direct (double lat1, double lon1, double azi1, double s12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
Direct geodesic problem specified in terms of arc length.
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
void ArcDirect (double lat1, double lon1, double azi1, double a12, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
General version of the direct geodesic solution.
double GenDirect (double lat1, double lon1, double azi1, bool arcmode, double s12_a12, Geodesic::mask outmask, [System::Runtime::InteropServices::Out] double% lat2, [System::Runtime::InteropServices::Out] double% lon2, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
 
Inverse geodesic problem.
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
double Inverse (double lat1, double lon1, double lat2, double lon2, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21)
 
General version of inverse geodesic solution.
double GenInverse (double lat1, double lon1, double lat2, double lon2, Geodesic::mask outmask, [System::Runtime::InteropServices::Out] double% s12, [System::Runtime::InteropServices::Out] double% azi1, [System::Runtime::InteropServices::Out] double% azi2, [System::Runtime::InteropServices::Out] double% m12, [System::Runtime::InteropServices::Out] double% M12, [System::Runtime::InteropServices::Out] double% M21, [System::Runtime::InteropServices::Out] double% S12)
 
Interface to GeodesicLine.
GeodesicLine Line (double lat1, double lon1, double azi1, NETGeographicLib::Mask caps)
 
GeodesicLine InverseLine (double lat1, double lon1, double lat2, double lon2, NETGeographicLib::Mask caps)
 
GeodesicLine DirectLine (double lat1, double lon1, double azi1, double s12, NETGeographicLib::Mask caps)
 
GeodesicLine ArcDirectLine (double lat1, double lon1, double azi1, double a12, NETGeographicLib::Mask caps)
 
GeodesicLine GenDirectLine (double lat1, double lon1, double azi1, bool arcmode, double s12_a12, NETGeographicLib::Mask caps)
 

Private Member Functions

 !Geodesic ()
 

Private Attributes

const GeographicLib::Geodesicm_pGeodesic
 

Inspector functions.

property double MajorRadius { double get()
 
property double Flattening { double get()
 
property double EllipsoidArea { double get()
 
System::IntPtr GetUnmanaged ()
 

Detailed Description

.NET wrapper for GeographicLib::Geodesic.

This class allows .NET applications to access GeographicLib::Geodesic.

The shortest path between two points on a ellipsoid at (lat1, lon1) and (lat2, lon2) is called the geodesic. Its length is s12 and the geodesic from point 1 to point 2 has azimuths azi1 and azi2 at the two end points. (The azimuth is the heading measured clockwise from north. azi2 is the "forward" azimuth, i.e., the heading that takes you beyond point 2 not back to point 1.) In the figure below, latitude if labeled φ, longitude λ (with λ12 = λ2 − λ1), and azimuth α.

spheroidal triangle

Given lat1, lon1, azi1, and s12, we can determine lat2, lon2, and azi2. This is the direct geodesic problem and its solution is given by the function Geodesic::Direct. (If s12 is sufficiently large that the geodesic wraps more than halfway around the earth, there will be another geodesic between the points with a smaller s12.)

Given lat1, lon1, lat2, and lon2, we can determine azi1, azi2, and s12. This is the inverse geodesic problem, whose solution is given by Geodesic::Inverse. Usually, the solution to the inverse problem is unique. In cases where there are multiple solutions (all with the same s12, of course), all the solutions can be easily generated once a particular solution is provided.

The standard way of specifying the direct problem is the specify the distance s12 to the second point. However it is sometimes useful instead to specify the arc length a12 (in degrees) on the auxiliary sphere. This is a mathematical construct used in solving the geodesic problems. The solution of the direct problem in this form is provided by Geodesic::ArcDirect. An arc length in excess of 180° indicates that the geodesic is not a shortest path. In addition, the arc length between an equatorial crossing and the next extremum of latitude for a geodesic is 90°.

This class can also calculate several other quantities related to geodesics. These are:

Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and Geodesic::Inverse allow these quantities to be returned. In addition there are general functions Geodesic::GenDirect, and Geodesic::GenInverse which allow an arbitrary set of results to be computed. The quantities m12, M12, M21 which all specify the behavior of nearby geodesics obey addition rules. If points 1, 2, and 3 all lie on a single geodesic, then the following rules hold:

Additional functionality is provided by the GeodesicLine class, which allows a sequence of points along a geodesic to be computed.

The shortest distance returned by the solution of the inverse problem is (obviously) uniquely defined. However, in a few special cases there are multiple azimuths which yield the same shortest distance. Here is a catalog of those cases:

The calculations are accurate to better than 15 nm (15 nanometers) for the WGS84 ellipsoid. See Sec. 9 of arXiv:1102.1215v1 for details. The algorithms used by this class are based on series expansions using the flattening f as a small parameter. These are only accurate for |f| < 0.02; however reasonably accurate results will be obtained for |f| < 0.2. Here is a table of the approximate maximum error (expressed as a distance) for an ellipsoid with the same major radius as the WGS84 ellipsoid and different values of the flattening.

    |f|      error
    0.01     25 nm
    0.02     30 nm
    0.05     10 um
    0.1     1.5 mm
    0.2     300 mm

For very eccentric ellipsoids, use GeodesicExact instead.

The algorithms are described in

For more information on geodesics see geodesic.

C# Example:

using System;
namespace example_Geodesic
{
class Program
{
static void Main(string[] args)
{
try {
Geodesic geod = new Geodesic( Constants.WGS84.MajorRadius,
Constants.WGS84.Flattening );
// Alternatively: Geodesic geod = new Geodesic();
{
// Sample direct calculation, travelling about NE from JFK
double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51;
double lat2, lon2;
geod.Direct(lat1, lon1, azi1, s12, out lat2, out lon2);
Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2));
}
{
// Sample inverse calculation, JFK to LHR
double
lat1 = 40.6, lon1 = -73.8, // JFK Airport
lat2 = 51.6, lon2 = -0.5; // LHR Airport
double s12;
geod.Inverse(lat1, lon1, lat2, lon2, out s12);
Console.WriteLine( s12 );
}
}
catch (GeographicErr e) {
Console.WriteLine(String.Format("Caught exception: {0}", e.Message));
}
}
}
}

Managed C++ Example:

// Example of using the GeographicLib::Geodesic class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f());
// Alternatively: const Geodesic& geod = Geodesic::WGS84();
{
// Sample direct calculation, travelling about NE from JFK
double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51;
double lat2, lon2;
geod.Direct(lat1, lon1, azi1, s12, lat2, lon2);
cout << lat2 << " " << lon2 << "\n";
}
{
// Sample inverse calculation, JFK to LHR
double
lat1 = 40.6, lon1 = -73.8, // JFK Airport
lat2 = 51.6, lon2 = -0.5; // LHR Airport
double s12;
geod.Inverse(lat1, lon1, lat2, lon2, s12);
cout << s12 << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Visual Basic Example:

Imports NETGeographicLib
Module example_Geodesic
Sub Main()
Try
Dim geod As Geodesic = New Geodesic(Constants.WGS84.MajorRadius,
Constants.WGS84.Flattening)
' Alternatively: Dim geod As Geodesic = new Geodesic()
' Sample direct calculation, travelling about NE from JFK
Dim lat1 As Double = 40.6, lon1 = -73.8, s12 = 5500000.0, azi1 = 51
Dim lat2, lon2 As Double
geod.Direct(lat1, lon1, azi1, s12, lat2, lon2)
Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2))
' Sample inverse calculation, JFK to LHR
lat1 = 40.6 : lon1 = -73.8 ' JFK Airport
lat2 = 51.6 : lon2 = -0.5 ' LHR Airport
geod.Inverse(lat1, lon1, lat2, lon2, s12)
Console.WriteLine(s12)
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
A default constructor has been provided that assumes WGS84 parameters.

The MajorRadius, Flattening, and EllipsoidArea functions are implemented as properties.

The GenDirect, GenInverse, and Line functions accept the "capabilities mask" as a NETGeographicLib::Mask rather than an unsigned.

Definition at line 170 of file Geodesic.h.

Member Enumeration Documentation

◆ mask

Bit masks for what calculations to do. These masks do double duty. They signify to the GeodesicLine::GeodesicLine constructor and to Geodesic::Line what capabilities should be included in the GeodesicLine object. They also specify which results to return in the general routines Geodesic::GenDirect and Geodesic::GenInverse routines. GeodesicLine::mask is a duplication of this enum.

Enumerator
NONE 

No capabilities, no output.

LATITUDE 

Calculate latitude lat2. (It's not necessary to include this as a capability to GeodesicLine because this is included by default.)

LONGITUDE 

Calculate longitude lon2.

AZIMUTH 

Calculate azimuths azi1 and azi2. (It's not necessary to include this as a capability to GeodesicLine because this is included by default.)

DISTANCE 

Calculate distance s12.

DISTANCE_IN 

Allow distance s12 to be used as input in the direct geodesic problem.

REDUCEDLENGTH 

Calculate reduced length m12.

GEODESICSCALE 

Calculate geodesic scales M12 and M21.

AREA 

Calculate area S12.

LONG_UNROLL 

Unroll lon2 in the direct calculation.

ALL 

All capabilities, calculate everything. (LONG_UNROLL is not included in this mask.)

Definition at line 187 of file Geodesic.h.

Constructor & Destructor Documentation

◆ !Geodesic()

Geodesic::!Geodesic ( )
private

Definition at line 23 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Geodesic() [1/2]

Geodesic::Geodesic ( double  a,
double  f 
)

Constructor for a ellipsoid with

Parameters
[in]aequatorial radius (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid.
Exceptions
GeographicErrif a or (1 − f ) a is not positive.

Definition at line 33 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Geodesic() [2/2]

Geodesic::Geodesic ( )

Constructor for the WGS84 ellipsoid.

Definition at line 50 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ~Geodesic()

NETGeographicLib::Geodesic::~Geodesic ( )
inline

the destructor calls the finalizer.

Definition at line 272 of file Geodesic.h.

Member Function Documentation

◆ ArcDirect() [1/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 195 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [2/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 206 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [3/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 219 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [4/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  m12 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 235 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [5/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 273 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [6/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21,
[System::Runtime::InteropServices::Out] double%  S12 
)

Solve the direct geodesic problem where the length of the geodesic is specified in terms of arc length.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]a12arc length between point 1 and point 2 (degrees); it can be negative.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).

lat1 should be in the range [−90°, 90°]. The values of lon2 and azi2 returned are in the range [−180°, 180°).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed, writing lat = ±(90° − ε), and taking the limit ε → 0+. An arc length greater that 180° signifies a geodesic which is not a shortest path. (For a prolate ellipsoid, an additional condition is necessary for a shortest path: the longitudinal extent must not exceed of 180°.)

The following functions are overloaded versions of Geodesic::Direct which omit some of the output parameters.

Definition at line 171 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirect() [7/7]

void Geodesic::ArcDirect ( double  lat1,
double  lon1,
double  azi1,
double  a12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::ArcDirect.

Definition at line 253 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ ArcDirectLine()

GeodesicLine Geodesic::ArcDirectLine ( double  lat1,
double  lon1,
double  azi1,
double  a12,
NETGeographicLib::Mask  caps 
)

Define a GeodesicLine in terms of the direct geodesic problem specified in terms of arc length.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]a12arc length between point 1 and point 2 (degrees); it can be negative.
[in]capsbitor'ed combination of Geodesic::mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLine::Position.
Returns
a GeodesicLine object.

This function sets point 3 of the GeodesicLine to correspond to point 2 of the direct geodesic problem.

lat1 should be in the range [−90°, 90°].

Definition at line 494 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [1/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2 
)

See the documentation for Geodesic::Direct.

Definition at line 86 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [2/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2 
)

See the documentation for Geodesic::Direct.

Definition at line 99 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [3/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12 
)

See the documentation for Geodesic::Direct.

Definition at line 114 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [4/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::Direct.

Definition at line 150 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [5/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21,
[System::Runtime::InteropServices::Out] double%  S12 
)

Solve the direct geodesic problem where the length of the geodesic is specified in terms of distance.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]s12distance between point 1 and point 2 (meters); it can be negative.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns
a12 arc length of between point 1 and point 2 (degrees).

lat1 should be in the range [−90°, 90°]. The values of lon2 and azi2 returned are in the range [−180°, 180°).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed, writing lat = ±(90° − ε), and taking the limit ε → 0+. An arc length greater that 180° signifies a geodesic which is not a shortest path. (For a prolate ellipsoid, an additional condition is necessary for a shortest path: the longitudinal extent must not exceed of 180°.)

The following functions are overloaded versions of Geodesic::Direct which omit some of the output parameters. Note, however, that the arc length is always computed and returned as the function value.

Definition at line 63 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Direct() [6/6]

double Geodesic::Direct ( double  lat1,
double  lon1,
double  azi1,
double  s12,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::Direct.

Definition at line 131 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ DirectLine()

GeodesicLine Geodesic::DirectLine ( double  lat1,
double  lon1,
double  azi1,
double  s12,
NETGeographicLib::Mask  caps 
)

Define a GeodesicLine in terms of the direct geodesic problem specified in terms of distance.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]s12distance between point 1 and point 2 (meters); it can be negative.
[in]capsbitor'ed combination of Geodesic::mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLine::Position.
Returns
a GeodesicLine object.

This function sets point 3 of the GeodesicLine to correspond to point 2 of the direct geodesic problem.

lat1 should be in the range [−90°, 90°].

Definition at line 486 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ GenDirect()

double Geodesic::GenDirect ( double  lat1,
double  lon1,
double  azi1,
bool  arcmode,
double  s12_a12,
Geodesic::mask  outmask,
[System::Runtime::InteropServices::Out] double%  lat2,
[System::Runtime::InteropServices::Out] double%  lon2,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21,
[System::Runtime::InteropServices::Out] double%  S12 
)

The general direct geodesic problem. Geodesic::Direct and Geodesic::ArcDirect are defined in terms of this function.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]arcmodeboolean flag determining the meaning of the s12_a12.
[in]s12_a12if arcmode is false, this is the distance between point 1 and point 2 (meters); otherwise it is the arc length between point 1 and point 2 (degrees); it can be negative.
[in]outmaska bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns
a12 arc length of between point 1 and point 2 (degrees).

The Geodesic::mask values possible for outmask are

  • outmask |= Geodesic::LATITUDE for the latitude lat2;
  • outmask |= Geodesic::LONGITUDE for the latitude lon2;
  • outmask |= Geodesic::AZIMUTH for the latitude azi2;
  • outmask |= Geodesic::DISTANCE for the distance s12;
  • outmask |= Geodesic::REDUCEDLENGTH for the reduced length m12;
  • outmask |= Geodesic::GEODESICSCALE for the geodesic scales M12 and M21;
  • outmask |= Geodesic::AREA for the area S12;
  • outmask |= Geodesic::ALL for all of the above;
  • outmask |= Geodesic::LONG_UNROLL to unroll lon2 instead of wrapping it into the range [−180°, 180°).

The function value a12 is always computed and returned and this equals s12_a12 is arcmode is true. If outmask includes Geodesic::DISTANCE and arcmode is false, then s12 = s12_a12. It is not necessary to include Geodesic::DISTANCE_IN in outmask; this is automatically included is arcmode is false.

With the LONG_UNROLL bit set, the quantity lon2lon1 indicates how many times and in what sense the geodesic encircles the ellipsoid.

Definition at line 295 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ GenDirectLine()

GeodesicLine Geodesic::GenDirectLine ( double  lat1,
double  lon1,
double  azi1,
bool  arcmode,
double  s12_a12,
NETGeographicLib::Mask  caps 
)

Define a GeodesicLine in terms of the direct geodesic problem specified in terms of either distance or arc length.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]arcmodeboolean flag determining the meaning of the s12_a12.
[in]s12_a12if arcmode is false, this is the distance between point 1 and point 2 (meters); otherwise it is the arc length between point 1 and point 2 (degrees); it can be negative.
[in]capsbitor'ed combination of Geodesic::mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLine::Position.
Returns
a GeodesicLine object.

This function sets point 3 of the GeodesicLine to correspond to point 2 of the direct geodesic problem.

lat1 should be in the range [−90°, 90°].

Definition at line 502 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ GenInverse()

double Geodesic::GenInverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
Geodesic::mask  outmask,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21,
[System::Runtime::InteropServices::Out] double%  S12 
)

The general inverse geodesic calculation. Geodesic::Inverse is defined in terms of this function.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]lat2latitude of point 2 (degrees).
[in]lon2longitude of point 2 (degrees).
[in]outmaska bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set.
[out]s12distance between point 1 and point 2 (meters).
[out]azi1azimuth at point 1 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns
a12 arc length of between point 1 and point 2 (degrees).

The Geodesic::mask values possible for outmask are

  • outmask |= Geodesic::DISTANCE for the distance s12;
  • outmask |= Geodesic::AZIMUTH for the latitude azi2;
  • outmask |= Geodesic::REDUCEDLENGTH for the reduced length m12;
  • outmask |= Geodesic::GEODESICSCALE for the geodesic scales M12 and M21;
  • outmask |= Geodesic::AREA for the area S12;
  • outmask |= Geodesic::ALL for all of the above.

The arc length is always computed and returned as the function value.

Definition at line 440 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ GetUnmanaged()

System::IntPtr Geodesic::GetUnmanaged ( )

return The unmanaged pointer to the GeographicLib::Geodesic.

This function is for internal use only.

Definition at line 465 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [1/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2 
)

See the documentation for Geodesic::Inverse.

Definition at line 356 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [2/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12 
)

See the documentation for Geodesic::Inverse.

Definition at line 346 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [3/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2 
)

See the documentation for Geodesic::Inverse.

Definition at line 368 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [4/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12 
)

See the documentation for Geodesic::Inverse.

Definition at line 383 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [5/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::Inverse.

Definition at line 419 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [6/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  m12,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21,
[System::Runtime::InteropServices::Out] double%  S12 
)

Solve the inverse geodesic problem.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]lat2latitude of point 2 (degrees).
[in]lon2longitude of point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]azi1azimuth at point 1 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns
a12 arc length of between point 1 and point 2 (degrees).

lat1 and lat2 should be in the range [−90°, 90°]. The values of azi1 and azi2 returned are in the range [−180°, 180°).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed, writing lat = ±(90° − ε), and taking the limit ε → 0+.

The solution to the inverse problem is found using Newton's method. If this fails to converge (this is very unlikely in geodetic applications but does occur for very eccentric ellipsoids), then the bisection method is used to refine the solution.

The following functions are overloaded versions of Geodesic::Inverse which omit some of the output parameters. Note, however, that the arc length is always computed and returned as the function value.

Definition at line 323 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Inverse() [7/7]

double Geodesic::Inverse ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
[System::Runtime::InteropServices::Out] double%  s12,
[System::Runtime::InteropServices::Out] double%  azi1,
[System::Runtime::InteropServices::Out] double%  azi2,
[System::Runtime::InteropServices::Out] double%  M12,
[System::Runtime::InteropServices::Out] double%  M21 
)

See the documentation for Geodesic::Inverse.

Definition at line 400 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ InverseLine()

GeodesicLine Geodesic::InverseLine ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
NETGeographicLib::Mask  caps 
)

Define a GeodesicLine in terms of the inverse geodesic problem.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]lat2latitude of point 2 (degrees).
[in]lon2longitude of point 2 (degrees).
[in]capsbitor'ed combination of Geodesic::mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLine::Position.
Returns
a GeodesicLine object.

This function sets point 3 of the GeodesicLine to correspond to point 2 of the inverse geodesic problem.

lat1 and lat2 should be in the range [−90°, 90°].

Definition at line 478 of file dotnet/NETGeographicLib/Geodesic.cpp.

◆ Line()

GeodesicLine Geodesic::Line ( double  lat1,
double  lon1,
double  azi1,
NETGeographicLib::Mask  caps 
)

Set up to compute several points on a single geodesic.

Parameters
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]capsbitor'ed combination of NETGeographicLib::Mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLine::Position.
Returns
a GeodesicLine object.

lat1 should be in the range [−90°, 90°].

The NETGeographicLib::Mask values are

If the point is at a pole, the azimuth is defined by keeping lon1 fixed, writing lat1 = ±(90 − ε), and taking the limit ε → 0+.

Definition at line 471 of file dotnet/NETGeographicLib/Geodesic.cpp.

Member Data Documentation

◆ EllipsoidArea

property double NETGeographicLib::Geodesic::EllipsoidArea { double get()
Returns
total area of ellipsoid in meters2. The area of a polygon encircling a pole can be found by adding Geodesic::EllipsoidArea()/2 to the sum of S12 for each side of the polygon.

Definition at line 844 of file Geodesic.h.

◆ Flattening

property double NETGeographicLib::Geodesic::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value used in the constructor.

Definition at line 836 of file Geodesic.h.

◆ m_pGeodesic

const GeographicLib::Geodesic* NETGeographicLib::Geodesic::m_pGeodesic
private

Definition at line 174 of file Geodesic.h.

◆ MajorRadius

property double NETGeographicLib::Geodesic::MajorRadius { double get()
Returns
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 830 of file Geodesic.h.


The documentation for this class was generated from the following files:
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
NETGeographicLib::Geodesic::Geodesic
Geodesic()
Definition: dotnet/NETGeographicLib/Geodesic.cpp:50
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
Constants.hpp
Header for GeographicLib::Constants class.
out
std::ofstream out("Result.txt")
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
Geodesic.hpp
Header for GeographicLib::Geodesic class.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:25:00