Package pygeodesy :: Module nvectorBase :: Class NvectorBase |
[frames] | no frames]

# Class NvectorBase

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
       vector3d.Vector3d --+
                           |
                          NvectorBase

Known Subclasses:
  - ellipsoidalNvector.Nvector
  - , sphericalNvector.Nvector

Base class for ellipsoidal and spherical `Nvector`s.

Instance Methods
__init__(self, x, y=None, z=None, h=0, ll=None, datum=None, name=`'````'`) New n-vector normal to the earth's surface. |
copy(self) Copy this vector. |
to3abh(self, height=None) Convert this n-vector to (geodetic) lat-, longitude in `radians` and height. |
to3llh(self, height=None) Convert this n-vector to (geodetic) lat-, longitude in `degrees` and height. |
to4xyzh(self, h=None) Return this n-vector's components as 4-tuple. |
toCartesian(self, h=None, Cartesian=None, datum=None, **kwds) Convert this n-vector to `Nvector`-based cartesian (ECEF) coordinates. |
toLatLon(self, height=None, LatLon=None, datum=None, **kwds) Convert this n-vector to an `Nvector`-based geodetic point. |
toStr(self, prec=5, fmt=`'``(%s)``'`, sep=`'``,` `'`) Return a string representation of this n-vector. |
toVector3d(self) Convert this n-vector to a normalized 3-d vector, ignoring the height. |
unit(self, ll=None) Normalize this vector to unit length. |
Inherited from `vector3d.Vector3d`: `__abs__`, `__add__`, `__cmp__`, `__div__`, `__eq__`, `__ge__`, `__gt__`, `__le__`, `__lt__`, `__matmul__`, `__mul__`, `__ne__`, `__neg__`, `__pos__`, `__radd__`, `__rmatmul__`, `__rsub__`, `__sub__`, `__truediv__`, `angleTo`, `cross`, `dividedBy`, `dot`, `equals`, `isequalTo`, `minus`, `negate`, `others`, `parse`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `to2ab`, `to2ll`, `to3xyz` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `toStr2` Inherited from `named._Named`: `__copy__`, `classof` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| Ecef Get the ECEF class (EcefKarney or EcefVeness).
| H Get the height prefix (`str`).
| datum Get the pass-thru datum (`Datum`) or `None`.
| h Get the height above surface (`meter`).
Inherited from `vector3d.Vector3d`: `crosserrors`, `length`, `x`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2` Inherited from `object`: `__class__`

Method Details

### __init__(self, x, y=None, z=None, h=0, ll=None, datum=None, name=`'````'`) (Constructor) |
New n-vector normal to the earth's surface. Parameters: `x` - An `Nvector`, Vector3Tuple, Vector4Tuple or the `X` coordinate (`scalar`). `y` - The `Y` coordinate (`scalar`) if `x` `scalar`. `z` - The `Z` coordinate (`scalar`) if `x` `scalar`. `h` - Optional height above surface (`meter`). `ll` - Optional, original latlon (`LatLon`). `datum` - Optional, pass-thru datum (`Datum`). `name` - Optional name (`str`). Raises: `TypeError` - Non-scalar `x`, `y` or `z` coordinate or `x` not an `Nvector`, Vector3Tuple or Vector4Tuple. Overrides: object.__init__ Example:
    >>> from pygeodesy.sphericalNvector 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: The copy (`Nvector` or subclass thereof). Overrides: named._Named.copy

### to3abh(self, height=None) |
Convert this n-vector to (geodetic) lat-, longitude in `radians` and height. Parameters: `height` - Optional height, overriding this n-vector's height (`meter`). Returns: A PhiLam3Tuple`(phi, lam, height)`.

### to3llh(self, height=None) |
Convert this n-vector to (geodetic) lat-, longitude in `degrees` and height. Parameters: `height` - Optional height, overriding this n-vector's height (`meter`). Returns: A LatLon3Tuple`(lat, lon, height)`.

### to4xyzh(self, h=None) |
Return this n-vector's components as 4-tuple. Parameters: `h` - Optional height, overriding this n-vector's height (`meter`). Returns: A Vector4Tuple`(x, y, z, h)`.

### toCartesian(self, h=None, Cartesian=None, datum=None, **kwds) |
Convert this n-vector to `Nvector`-based cartesian (ECEF) coordinates. Parameters: `height` - Optional height, overriding this n-vector's height (`meter`). `Cartesian` - Optional (sub-)class to return the (ECEF)coordinates (`Cartesian`). `datum` - Optional, spherical datum (`Datum`). `kwds` - Optional, additional `name=value` pairs for `Cartesian` instance, provided `Cartesian` is not `None`. Returns: Cartesian (ECEF) coordinates (`Cartesian`). Raises: `TypeError` - Invalid `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

### toLatLon(self, height=None, LatLon=None, datum=None, **kwds) |
Convert this n-vector to an `Nvector`-based geodetic point. Parameters: `height` - Optional height, overriding this n-vector's height (`meter`). `LatLon` - Optional (sub-)class to return the point (`LatLon`) or `None`. `datum` - Optional, spherical datum (`Datum`). `kwds` - Optional, additional `name=value` pairs for `LatLon` instance, provided `LatLon` is not `None`. Returns: The `LatLon` point (`LatLon`) or if `LatLon=None` or a LatLon3Tuple`(lat, lon, height)` if `LatLon` is `None`. Raises: `TypeError` - Invalid `LatLon`. Example:
    >>> v = Nvector(0.5, 0.5, 0.7071)
    >>> p = v.toLatLon()  # 45.0°N, 45.0°E

### toStr(self, prec=5, fmt=`'``(%s)``'`, sep=`'``,` `'`) |
Return a string representation of this n-vector. Height component is only included if non-zero. Parameters: `prec` - Optional number of decimals, unstripped (`int`). `fmt` - Optional enclosing backets format (`str`). `sep` - Optional separator between components (`str`). Returns: Comma-separated `"(x, y, z [, h])"` enclosed in `fmt` brackets (`str`). Overrides: named._Named.toStr Example:
    >>> Nvector(0.5, 0.5, 0.7071).toStr()  # (0.5, 0.5, 0.7071)
    >>> Nvector(0.5, 0.5, 0.7071, 1).toStr(-3)  # (0.500, 0.500, 0.707, +1.00)

### toVector3d(self) |
Convert this n-vector to a normalized 3-d vector, ignoring the height. Returns: Normalized vector (Vector3d).

### unit(self, ll=None) |
Normalize this vector to unit length. Parameters: `ll` - Optional, original latlon (`LatLon`). Returns: Normalized vector (`Nvector`). Overrides: vector3d.Vector3d.unit

Property Details

### Ecef Get the ECEF class (EcefKarney or EcefVeness). Get Method: Ecef(self) - Get the ECEF class (EcefKarney or EcefVeness). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### H Get the height prefix (`str`). Get Method: H(self) - Get the height prefix (`str`). Set Method: H(self, H) - Set the height prefix.

### datum Get the pass-thru datum (`Datum`) or `None`. Get Method: datum(self) - Get the pass-thru datum (`Datum`) or `None`. Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### h Get the height above surface (`meter`). Get Method: h(self) - Get the height above surface (`meter`). Set Method: h(self, h) - Set the height above surface.