Class: GeodesicLine

GeographicLib/GeodesicLine. GeodesicLine

Performs geodesic calculations along a given geodesic line. This object is usually instantiated by Geodesic.Line. The methods Geodesic.DirectLine and Geodesic.InverseLine set in addition the position of a reference point 3.

Constructor

new GeodesicLine(geod, lat1, lon1, azi1, capsopt)

Initialize a GeodesicLine object. For details on the caps parameter, see The library interface, "The outmask and caps parameters".

Parameters:
Name Type Attributes Default Description
geod object

a Geodesic object.

lat1 number

the latitude of the first point in degrees.

lon1 number

the longitude of the first point in degrees.

azi1 number

the azimuth at the first point in degrees.

caps bitmask <optional>
STANDARD | DISTANCE_IN

which capabilities to include; LATITUDE | AZIMUTH are always included.

Properties:
Name Type Description
a number

the equatorial radius (meters).

f number

the flattening.

lat1 number

the initial latitude (degrees).

lon1 number

the initial longitude (degrees).

azi1 number

the initial azimuth (degrees).

salp1 number

the sine of the azimuth at the first point.

calp1 number

the cosine the azimuth at the first point.

s13 number

the distance to point 3 (meters).

a13 number

the arc length to point 3 (degrees).

caps bitmask

the capabilities of the object.

Source:

Methods

ArcPosition(a12, outmaskopt) → {object}

Find the position on the line given a12.

The lat1, lon1, azi1, and a12 fields of the result are always set. For details on the outmask parameter, see The library interface, "The outmask and caps parameters".

Parameters:
Name Type Attributes Default Description
a12 number

the arc length from the first point to the second in degrees.

outmask bitmask <optional>
STANDARD

which results to include; this is subject to the capabilities of the object.

Source:
Returns:

the requested results.

Type
object

GenPosition(arcmode, s12_a12, outmaskopt) → {object}

Find the position on the line (general case).

The lat1, lon1, azi1, and a12 fields of the result are always set; s12 is included if arcmode is false. For details on the outmask parameter, see The library interface, "The outmask and caps parameters".

Parameters:
Name Type Attributes Default Description
arcmode bool

is the next parameter an arc length?

s12_a12 number

the (arcmode ? arc length : distance) from the first point to the second in (arcmode ? degrees : meters).

outmask bitmask <optional>
STANDARD

which results to include; this is subject to the capabilities of the object.

Source:
Returns:

the requested results.

Type
object

GenSetDistance(arcmode, s13_a13)

Specify position of point 3 in terms of either distance or arc length.

Parameters:
Name Type Description
arcmode bool

boolean flag determining the meaning of the second parameter; if arcmode is false, then the GeodesicLine object must have been constructed with caps |= DISTANCE_IN.

s13_a13 number

if arcmode is false, this is the distance from point 1 to point 3 (meters); otherwise it is the arc length from point 1 to point 3 (degrees); it can be negative.

Source:

Position(s12, outmaskopt) → {object}

Find the position on the line given s12.

The lat1, lon1, azi1, s12, and a12 fields of the result are always set; s12 is included if arcmode is false. For details on the outmask parameter, see The library interface, "The outmask and caps parameters".

Parameters:
Name Type Attributes Default Description
s12 number

the distance from the first point to the second in meters.

outmask bitmask <optional>
STANDARD

which results to include; this is subject to the capabilities of the object.

Source:
Returns:

the requested results.

Type
object

SetArc(a13)

Specify position of point 3 in terms of arc length.

Parameters:
Name Type Description
a13 number

the arc length from point 1 to point 3 (degrees); it can be negative.

Source:

SetDistance(s13)

Specify position of point 3 in terms distance.

Parameters:
Name Type Description
s13 number

the distance from point 1 to point 3 (meters); it can be negative.

Source: