Package pygeodesy :: Module ellipsoidalNvector :: Class Nvector
[frames] | no frames]

Class Nvector

   object --+            
            |            
   bases.Base --+        
                |        
vector3d.Vector3d --+    
                    |    
      nvector.Nvector --+
                        |
                       Nvector

An n-vector is a position representation using a (unit) vector normal to the earth ellipsoid. Unlike lat-/longitude points, n-vectors have no singularities or discontinuities.

For many applications, n-vectors are more convenient to work with than other position representations like lat-/longitude, earth-centred earth-fixed (ECEF) vectors, UTM coordinates, etc.

Note commonality with sphericalNvector.Nvector.

Instance Methods
 
__init__(self, x, y, z, h=0, datum=None)
New n-vector normal to the earth's surface.
 
copy(self)
Copy this vector.
 
toLatLon(self, height=None, LatLon=<class 'pygeodesy.ellipsoidalNvector.LatLon'>)
Convert this n-vector to an (ellipsoidal) geodetic point.
 
toCartesian(self, Cartesian=<class 'pygeodesy.ellipsoidalNvector.Cartesian'>)
Convert this n-vector to a cartesian point.
 
unit(self)
Normalize this vector to unit length.

Inherited from nvector.Nvector: to3llh, to4xyzh, toStr, toVector3d

Inherited from vector3d.Vector3d: __abs__, __add__, __cmp__, __div__, __eq__, __ge__, __gt__, __iadd__, __imatmul__, __imul__, __isub__, __itruediv__, __le__, __lt__, __matmul__, __mul__, __ne__, __neg__, __pos__, __radd__, __rmatmul__, __rmul__, __rsub__, __sub__, __truediv__, angleTo, cross, dividedBy, dot, equals, minus, negate, others, parse, plus, rotate, rotateAround, sum, times, to2ll, to3xyz

Inherited from bases.Base: __repr__, __str__, classname, classof, toStr2

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables

Inherited from nvector.Nvector: H

Properties
  datum
Get this n-vector's datum (Datum).

Inherited from nvector.Nvector: h

Inherited from vector3d.Vector3d: length, x, y, z

Inherited from object: __class__

Method Details

__init__(self, x, y, z, h=0, datum=None)
(Constructor)

 

New n-vector normal to the earth's surface.

Parameters:
  • x - X component (scalar).
  • y - Y component (scalar).
  • z - Z component (scalar).
  • h - Height above model surface (meter).
  • datum - Optional datum this n-vector is defined within (Datum).
Raises:
  • TypeError - If datum is not a Datum.
Overrides: object.__init__

Example:

>>> from ellipsoidalNvector import Nvector
>>> v = Nvector(0.5, 0.5, 0.7071, 1)
>>> v.toLatLon()  # 45.0°N, 045.0°E, +1.00m

copy(self)

 

Copy this vector.

Returns:
Copy (Nvector).
Overrides: vector3d.Vector3d.copy

toLatLon(self, height=None, LatLon=<class 'pygeodesy.ellipsoidalNvector.LatLon'>)

 

Convert this n-vector to an (ellipsoidal) geodetic point.

Parameters:
  • height - Optional height, overriding the default height (meter).
  • LatLon - LatLon class for the point (LatLon).
Returns:
Point equivalent to this n-vector (LatLon).

Example:

>>> v = Nvector(0.5, 0.5, 0.7071)
>>> p = v.toLatLon()  # 45.0°N, 45.0°E

toCartesian(self, Cartesian=<class 'pygeodesy.ellipsoidalNvector.Cartesian'>)

 

Convert this n-vector to a cartesian point.

Parameters:
  • Cartesian - Cartesian class for the point (Cartesian).
Returns:
Cartesian equivalent to this n-vector (Cartesian).

Example:

>>> v = Nvector(0.5, 0.5, 0.7071)
>>> c = v.toCartesian()  # [3194434, 3194434, 4487327]
>>> p = c.toLatLon()  # 45.0°N, 45.0°E

unit(self)

 

Normalize this vector to unit length.

Returns:
Normalised vector (Nvector).
Overrides: vector3d.Vector3d.unit

Property Details

datum

Get this n-vector's datum (Datum).

Get Method:
datum(self) - Get this n-vector's datum (Datum).