Constructor
new Position(latitude, longitude, altitude)
Constructs a position from a specified latitude and longitude in degrees and altitude in meters.
Parameters:
Name | Type | Description |
---|---|---|
latitude |
Number | The latitude in degrees. |
longitude |
Number | The longitude in degrees. |
altitude |
Number | The altitude in meters. |
- Source:
Members
(static, constant) ZERO :Position
A Position with latitude, longitude and altitude all 0.
Type:
- Source:
altitude :Number
The altitude in meters.
Type:
- Number
- Source:
latitude :Number
The latitude in degrees.
Type:
- Number
- Source:
longitude :Number
The longitude in degrees.
Type:
- Number
- Source:
Methods
(static) fromRadians(latitudeRadians, longitudeRadians, altitude) → {Position}
Creates a position from angles specified in radians.
Parameters:
Name | Type | Description |
---|---|---|
latitudeRadians |
Number | The latitude in radians. |
longitudeRadians |
Number | The longitude in radians. |
altitude |
Number | The altitude in meters. |
- Source:
Returns:
The new position with latitude and longitude in degrees.
- Type
- Position
(static) interpolateGreatCircle(amount, position1, position2, result) → {Position}
Computes a position along a great circle path at a specified distance between two specified positions.
Parameters:
Name | Type | Description |
---|---|---|
amount |
Number | The fraction of the path between the two positions at which to compute the new position. This number should be between 0 and 1. If not, it is clamped to the nearest of those values. |
position1 |
Position | The starting position. |
position2 |
Position | The ending position. |
result |
Position | A Position in which to return the result. |
- Source:
Throws:
-
If either specified position or the result argument is null or undefined.
- Type
- ArgumentError
Returns:
The specified result position.
- Type
- Position
(static) interpolateLinear(amount, position1, position2, result) → {Position}
Computes a position along a linear path at a specified distance between two specified positions.
Parameters:
Name | Type | Description |
---|---|---|
amount |
Number | The fraction of the path between the two positions at which to compute the new position. This number should be between 0 and 1. If not, it is clamped to the nearest of those values. |
position1 |
Position | The starting position. |
position2 |
Position | The ending position. |
result |
Position | A Position in which to return the result. |
- Source:
Throws:
-
If either specified position or the result argument is null or undefined.
- Type
- ArgumentError
Returns:
The specified result position.
- Type
- Position
(static) interpolateRhumb(amount, position1, position2, result) → {Position}
Computes a position along a rhumb path at a specified distance between two specified positions.
Parameters:
Name | Type | Description |
---|---|---|
amount |
Number | The fraction of the path between the two positions at which to compute the new position. This number should be between 0 and 1. If not, it is clamped to the nearest of those values. |
position1 |
Position | The starting position. |
position2 |
Position | The ending position. |
result |
Position | A Position in which to return the result. |
- Source:
Throws:
-
If either specified position or the result argument is null or undefined.
- Type
- ArgumentError
Returns:
The specified result position.
- Type
- Position
copy(position) → {Position}
Sets this position to the latitude, longitude and altitude of a specified position.
Parameters:
Name | Type | Description |
---|---|---|
position |
Position | The position to copy. |
- Source:
Throws:
-
If the specified position is null or undefined.
- Type
- ArgumentError
Returns:
This position, set to the values of the specified position.
- Type
- Position
equals(position) → {Boolean}
Indicates whether this position has the same latitude, longitude and altitude as a specified position.
Parameters:
Name | Type | Description |
---|---|---|
position |
Position | The position to compare with this one. |
- Source:
Returns:
true if this position is equal to the specified one, otherwise false.
- Type
- Boolean
toString() → {String}
Returns a string representation of this position.
- Source:
Returns:
- Type
- String