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

# Class Nvector

      object --+
               |
    bases._Named --+
                   |
        bases._Based --+
                       |
      bases._VectorBased --+
                           |
           vector3d.Vector3d --+
                               |
                 nvector.Nvector --+
                                   |
                                  Nvector

An n-vector is a position representation using a (unit) vector normal to the earth's surface. 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.

On a spherical model earth, an n-vector is equivalent to an earth-centred earth-fixed (ECEF) vector.

Note commonality with ellipsoidalNvector.Nvector.

Instance Methods
toLatLon(self, height=None, LatLon=<class 'pygeodesy.sphericalNvector.LatLon'>) Convert this n-vector to a (spherical) geodetic point. |
greatCircle(self, bearing) Compute the n-vector normal to great circle obtained by heading on given compass bearing from this point as its n-vector. |
Inherited from `nvector.Nvector`: `__init__`, `copy`, `to3abh`, `to3llh`, `to4xyzh`, `toStr`, `toVector3d`, `unit` 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`, `isequalTo`, `minus`, `negate`, `others`, `parse`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `to2ab`, `to2ll`, `to3xyz` Inherited from `bases._Based`: `__repr__`, `__str__`, `classof`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables
Inherited from `nvector.Nvector`: `H`

Properties
Inherited from `nvector.Nvector`: `h` Inherited from `vector3d.Vector3d`: `crosserrors`, `length`, `x`, `y`, `z` Inherited from `bases._Named`: `classname`, `classnaming`, `name` Inherited from `object`: `__class__`

Method Details

### toLatLon(self, height=None, LatLon=<class 'pygeodesy.sphericalNvector.LatLon'>) |
Convert this n-vector to a (spherical) geodetic point. Parameters: `height` - Optional height above earth radius, overriding the default height (`meter`). `LatLon` - Optional (spherical) LatLon (sub-)class to return the point (LatLon) or `None`. Returns: Point equivalent to this n-vector (LatLon) or 3-tuple (`degrees90`, `degrees180`, height) if LatLon is `None`. Example:
    >>> n = Nvector(0.5, 0.5, 0.7071)
    >>> p = n.toLatLon()  # 45.0°N, 45.0°E

### greatCircle(self, bearing) |
Compute the n-vector normal to great circle obtained by heading on given compass bearing from this point as its n-vector. Direction of vector is such that initial bearing vector b = c × p. Parameters: `bearing` - Initial compass bearing (`degrees`). Returns: N-vector representing great circle (Nvector). Raises: `Valuerror` - Polar coincidence. Example:
    >>> n = LatLon(53.3206, -1.7297).toNvector()
    >>> gc = n.greatCircle(96.0)  # [-0.794, 0.129, 0.594]