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

# Class Nvector

           object --+
                    |
         named._Named --+
                        |
         named._NamedBase --+
                            |
    vector3dBase.Vector3dBase --+
                                |
                vector3d.Vector3d --+
                                    |
              nvectorBase.NvectorBase --+
                                        |
                                       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_xyz, y=None, z=None, h=0, datum=None, ll=None, name='') New n-vector normal to the earth's surface. |
toCartesian(self, **Cartesian_and_kwds) Convert this n-vector to `Nvector`-based cartesian (ECEF) coordinates. |
toLatLon(self, **LatLon_and_kwds) Convert this n-vector to an `Nvector`-based geodetic point. |
unit(self, ll=None) Normalize this vector to unit length. |
Inherited from `nvectorBase.NvectorBase`: `hStr`, `to2ab`, `to2ll`, `to3abh`, `to3llh`, `to4xyzh`, `toStr`, `toVector3d` Inherited from `vector3d.Vector3d`: `circin6`, `circum3`, `circum4_`, `iscolinearWith`, `meeus2`, `nearestOn`, `nearestOn6`, `parse`, `radii11`, `soddy4`, `trilaterate2d2`, `trilaterate3d2` Inherited from `vector3dBase.Vector3dBase`: `__abs__`, `__add__`, `__bool__`, `__cmp__`, `__div__`, `__divmod__`, `__eq__`, `__floordiv__`, `__format__`, `__ge__`, `__gt__`, `__iadd__`, `__idiv__`, `__imatmul__`, `__imul__`, `__int__`, `__isub__`, `__itruediv__`, `__le__`, `__long__`, `__lt__`, `__matmul__`, `__mod__`, `__mul__`, `__ne__`, `__neg__`, `__nonzero__`, `__pos__`, `__pow__`, `__radd__`, `__rdiv__`, `__rdivmod__`, `__rfloordiv__`, `__rmatmul__`, `__rmod__`, `__rmul__`, `__round__`, `__rpow__`, `__rsub__`, `__rtruediv__`, `__sub__`, `__truediv__`, `__trunc__`, `angleTo`, `apply`, `cmp`, `cross`, `dividedBy`, `dot`, `equals`, `equirectangular`, `intermediateTo`, `isconjugateTo`, `isequalTo`, `minus`, `negate`, `others`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `times_`, `to3xyz` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `dup`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| datum Get this n-vector's datum (Datum).
Inherited from `nvectorBase.NvectorBase`: `Ecef`, `H`, `h`, `isEllipsoidal`, `isSpherical`, `lam`, `lat`, `latlon`, `latlonheight`, `latlonheightdatum`, `lon`, `phi`, `philam`, `philamheight`, `philamheightdatum`, `xyzh` Inherited from `vector3dBase.Vector3dBase`: `crosserrors`, `euclid`, `length`, `length2`, `x`, `x2y2z2`, `xyz`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, x_xyz, y=None, z=None, h=0, datum=None, ll=None, name='') (Constructor) |
New n-vector normal to the earth's surface. Arguments: `x_xyz` - X component of vector (`scalar`) or (3-D) vector (`Nvector`, Vector3d, Vector3Tuple or Vector4Tuple). `y` - Y component of vector (`scalar`), ignored if `x_xyz` is not `scalar`, otherwise same units as `x_xyz`. `z` - Z component of vector (`scalar`), ignored if `x_xyz` is not `scalar`, otherwise same units as `x_xyz`. `h` - Optional height above model surface (`meter`). `datum` - Optional datum this n-vector is defined in (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `ll` - Optional, original latlon (`LatLon`). `name` - Optional name (`str`). 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

### toCartesian (self, **Cartesian_and_kwds) |
Convert this n-vector to `Nvector`-based cartesian (ECEF) coordinates. Arguments: `Cartesian_and_kwds` - Optional Cartesian, `h`, `datum` and other keyword arguments. Use `Cartesian=...` to override this Cartesian class or specify `Cartesian is None`. Returns: The cartesian point (Cartesian) or if `Cartesian` is set to `None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `C` and `M` if available. Raises: `TypeError` - Invalid `Cartesian_and_kwds`. Overrides: nvectorBase.NvectorBase.toCartesian Example:
    >>> v = Nvector(0.5, 0.5, 0.7071)
    >>> c = v.toCartesian()  # [3194434, 3194434, 4487327]
    >>> p = c.toLatLon()  # 45.0°N, 45.0°E

### toLatLon (self, **LatLon_and_kwds) |
Convert this n-vector to an `Nvector`-based geodetic point. Arguments: `LatLon_and_kwds` - Optional LatLon, `height`, `datum` and other keyword arguments. Use `LatLon=...` to override this LatLon class or specify `LatLon is None`. Returns: The geodetic point (LatLon) or if `LatLon` is set to `None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `C` and `M` if available. Raises: `TypeError` - Invalid `LatLon_and_kwds`. Overrides: nvectorBase.NvectorBase.toLatLon Example:
    >>> v = Nvector(0.5, 0.5, 0.7071)
    >>> p = v.toLatLon()  # 45.0°N, 45.0°E

### unit (self, ll=None) |
Normalize this vector to unit length. Arguments: `ll` - Optional, original latlon (`LatLon`). Returns: Normalised vector (Nvector). Overrides: vector3dBase.Vector3dBase.unit

Property Details

### datum Get this n-vector's datum (Datum). Get method: datum(self) - Get this n-vector's datum (Datum). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.