UserPosition
Class: UserPosition
A Coordinates User Position is a Coordinates position with specific data related to user (bearing, time, accuracy)
Extends
Constructors
Constructor
new UserPosition(
lat,lng,alt?,level?,time?,accuracy?,bearing?):UserPosition
Parameters
lat
number
lng
number
alt?
number | null
level?
Level_t = null
time?
number | null
accuracy?
number | null
bearing?
number | null
Returns
UserPosition
Overrides
Properties
autoWrap
autoWrap:
boolean=true
Inherited from
Accessors
accuracy
Get Signature
get accuracy():
number|null
Returns
number | null
Set Signature
set accuracy(
accuracy):void
Parameters
accuracy
number | null
Returns
void
alt
Get Signature
get alt():
number|null
alt does not denote the altitude of a point but its height from the "level" field (if defined) or from the ground /!\ This is the providers' convention, not GeoRef's: see the class header.
Returns
number | null
Set Signature
set alt(
alt):void
Parameters
alt
number | null
Returns
void
Inherited from
bearing
Get Signature
get bearing():
number|null
Returns
number | null
Set Signature
set bearing(
bearing):void
Parameters
bearing
number | null
Returns
void
ecef
Get Signature
get ecef():
Vector3_t
https://gist.github.com/klucar/1536194
Returns
Vector3_t
Inherited from
ecefToEnuRotation
Get Signature
get ecefToEnuRotation():
Quaternion_t
Returns
Quaternion_t
Inherited from
enuToEcefRotation
Get Signature
get enuToEcefRotation():
Quaternion_t
ECEF Transformations (WGS84 ellipsoid)
Returns
Quaternion_t
Inherited from
heightFromFloor
Get Signature
get heightFromFloor():
number|null
Returns
number | null
Set Signature
set heightFromFloor(
heightFromFloor):void
Parameters
heightFromFloor
number | null
Returns
void
Inherited from
heightFromGround
Get Signature
get heightFromGround():
number|null
Returns
number | null
Set Signature
set heightFromGround(
heightFromGround):void
Parameters
heightFromGround
number | null
Returns
void
Inherited from
lat
Get Signature
get lat():
number
Returns
number
Set Signature
set lat(
lat):void
Parameters
lat
number
Returns
void
Inherited from
latitude
Get Signature
get latitude():
number
Returns
number
Set Signature
set latitude(
_):void
Parameters
_
number
Returns
void
Inherited from
level
Get Signature
get level():
Level_t
Returns
Level_t
Set Signature
set level(
level):void
Parameters
level
Level_t
Returns
void
Inherited from
lng
Get Signature
get lng():
number
Returns
number
Set Signature
set lng(
lng):void
Parameters
lng
number
Returns
void
Inherited from
longitude
Get Signature
get longitude():
number
Returns
number
Set Signature
set longitude(
_):void
Parameters
_
number
Returns
void
Inherited from
time
Get Signature
get time():
number|null
Returns
number | null
Set Signature
set time(
time):void
Parameters
time
number | null
Returns
void
Methods
bearingTo()
bearingTo(
location2):number
Azimuth to another point, in radians, clockwise from north. Taken in the local ENU frame, so it matches the true geodesic azimuth within 0.02" even at 100km.
Parameters
location2
Returns
number
Inherited from
clone()
clone():
UserPosition
Deep clone coordinates
Returns
UserPosition
Overrides
destinationPoint()
destinationPoint(
distance,bearing,elevation?):UserPosition
Parameters
distance
number
bearing
number
elevation?
number | null
Returns
UserPosition
Throws
if elevation is defined and point altitude is not defined
Overrides
distanceTo()
distanceTo(
location2):number
Returns the ground distance between two points in meters, on the WGS84 ellipsoid. Altitudes are ignored, as many callers compare positions across levels.
The chord between the two ECEF points is exact; converting it back to an arc length on the locally fitting sphere is what costs accuracy, and it costs very little: 3nm at 340m, 3um at 14km, 1.2m at 557km.
The one case where this is worse than the old haversine is a path along the equator, where the arc radius is R_MAJOR but the Gaussian radius is R_MINOR: 264m over 3340km, 9.3km over 10000km, against an exact haversine there. Everywhere else, and at every distance this SDK works at, it is orders of magnitude better.
Parameters
location2
Returns
number
Inherited from
equals()
equals(
other,eps?,epsAlt?):boolean
Parameters
other
UserPosition | Coordinates | null
eps?
number = EPS_DEG_MM
epsAlt?
number = EPS_MM
Returns
boolean
Overrides
equalsWithoutLevel()
equalsWithoutLevel(
other,eps?,epsAlt?):boolean
Parameters
other
eps?
number = EPS_DEG_MM
epsAlt?
number = EPS_MM
Returns
boolean
Inherited from
Coordinates.equalsWithoutLevel
getSegmentProjection()
getSegmentProjection(
p1,p2):Coordinates|null
Great-circle geometry, so it stays on the sphere: normalizing an ellipsoidal ECEF vector would yield a geocentric direction and shift the projection by tens of meters. The closure test that rejects a point off the segment measures angles between the same unit vectors, for the same reason: mixing in the geodesic distanceTo would compare a great circle with a geodesic and reject valid projections on long segments.
Parameters
p1
p2
Returns
Coordinates | null
Inherited from
Coordinates.getSegmentProjection
move()
move(
distance,bearing,elevation?):UserPosition
Moves the point by a ground distance (in meters) along a bearing, on the WGS84 ellipsoid. The displacement is built in the local ENU frame as the chord of the arc travelled, then converted back through ECEF. ponytail: micrometer-accurate at working range (7um at 10km), then degrades as distance^3 / radius^2 (7mm at 100km, ~20m at 1200km). Use Karney's geodesics if continental distances ever matter.
Parameters
distance
number
bearing
number
elevation?
number | null
Returns
UserPosition
Throws
if elevation is defined and point altitude is not defined
Overrides
toCompressedJson()
toCompressedJson():
CoordinatesCompressedJson
Returns
CoordinatesCompressedJson
Inherited from
toJson()
toJson():
UserPositionJson
Returns
UserPositionJson
Overrides
toString()
toString():
string
Input / Output
Returns
string
Inherited from
wrap()
wrap():
void
Returns
void
Inherited from
bearingTo()
staticbearingTo(point1,point2):number
Parameters
point1
point2
Returns
number
Inherited from
distanceBetween()
staticdistanceBetween(point1,point2):number
Parameters
point1
point2
Returns
number
Inherited from
equals()
staticequals(pos1,pos2,eps?,epsAlt?):boolean
Parameters
pos1
UserPosition | Coordinates | null
pos2
UserPosition | Coordinates | null
eps?
number = EPS_DEG_MM
epsAlt?
number = EPS_MM
Returns
boolean
Overrides
equalsWithoutLevel()
staticequalsWithoutLevel(pos1,pos2,eps?,epsAlt?):boolean
Parameters
pos1
Coordinates | null
pos2
Coordinates | null
eps?
number = EPS_DEG_MM
epsAlt?
number = EPS_MM
Returns
boolean
Inherited from
Coordinates.equalsWithoutLevel
fromCompressedJson()
staticfromCompressedJson(json):Coordinates
Parameters
json
CoordinatesCompressedJson
Returns
Inherited from
Coordinates.fromCompressedJson
fromCoordinates()
staticfromCoordinates(coordinates):UserPosition
Parameters
coordinates
Returns
UserPosition
fromECEF()
staticfromECEF(ecef):Coordinates
Parameters
ecef
Vector3_t
Returns
Inherited from
fromJson()
staticfromJson(json):UserPosition
Parameters
json
UserPositionJson
Returns
UserPosition