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

# Class Nvector

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
       bases._VectorBase --+
                           |
           vector3d.Vector3d --+
                               |
                              Nvector

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

Base class for ellipsoidal and spherical Nvector.

Instance Methods
__init__(self, x, y, z, h=0, ll=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 and height. |
to3llh(self, height=None) Convert this n-vector to (geodetic) lat-, longitude and height. |
to4xyzh(self, h=None) Return this n-vector as a 4-tuple. |
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__`, `__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 `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__`

Class Variables
| H = ``'````'`` Heigth prefix (`str`), '↑' in JS version

Properties
| 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, z, h=0, ll=None, name=`'````'`) (Constructor) |
New n-vector normal to the earth's surface. Parameters: `x` - X component (`scalar`). `y` - Y component (`scalar`). `z` - Z component (`scalar`). `h` - Optional height above surface (`meter`). `ll` - Optional, original latlon (`LatLon`). `name` - Optional name (`str`). Overrides: object.__init__ Example:
    >>> from 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 and height. Parameters: `height` - Optional height, overriding this n-vector's height (`meter`). Returns: A PhiLam3Tuple`(phi, lambda, height)`.

### to3llh(self, height=None) |
Convert this n-vector to (geodetic) lat-, longitude 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 as a 4-tuple. Parameters: `h` - Optional height, overriding this n-vector's height (`meter`). Returns: A Vector4Tuple`(x, y, z, h)` in `meter`.

### 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._NamedBase.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

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