Package pygeodesy :: Module sphericalNvector :: 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'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
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. |
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 `nvectorBase.NvectorBase`: `__init__`, `hStr`, `to2ab`, `to2ll`, `to3abh`, `to3llh`, `to4xyzh`, `toStr`, `toVector3d`, `unit` Inherited from `vector3d.Vector3d`: `circum3`, `iscolinearWith`, `meeus2`, `nearestOn`, `parse`, `trilaterate2d2`, `trilaterate3d2` Inherited from `vector3dBase.Vector3dBase`: `__abs__`, `__add__`, `__cmp__`, `__div__`, `__eq__`, `__ge__`, `__gt__`, `__le__`, `__lt__`, `__matmul__`, `__mul__`, `__ne__`, `__neg__`, `__pos__`, `__radd__`, `__rmatmul__`, `__rsub__`, `__sub__`, `__truediv__`, `angleTo`, `cmp`, `cross`, `dividedBy`, `dot`, `equals`, `isconjugateTo`, `isequalTo`, `minus`, `negate`, `others`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `to3xyz` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `nvectorBase.NvectorBase`: `Ecef`, `H`, `datum`, `h`, `isEllipsoidal`, `isSpherical`, `lam`, `lat`, `latlon`, `latlonheight`, `latlonheightdatum`, `lon`, `phi`, `philam`, `philamheight`, `philamheightdatum`, `xyzh` Inherited from `vector3dBase.Vector3dBase`: `crosserrors`, `euclid`, `length`, `length2`, `x`, `xyz`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### toCartesian (self, **Cartesian_and_kwds) |
Convert this n-vector to `Nvector`-based cartesian (ECEF) coordinates. Arguments: `Cartesian_and_kwds` - Optional Cartesian, `h` and other keyword arguments. Use `Cartesian=...` to override this Cartesian class or specify `Cartesian=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

### toLatLon (self, **LatLon_and_kwds) |
Convert this n-vector to an `Nvector`-based geodetic point. Arguments: `LatLon_and_kwds` - Optional LatLon, `height` and other keyword arguments. Use `LatLon=...` to override this LatLon class or specify `LatLon=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`. `ValueError` - Invalid `height`. Overrides: nvectorBase.NvectorBase.toLatLon

### 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. Arguments: `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]