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

# Class Nvector

     object --+
              |
    bases.Named --+
                  |
        bases.Based --+
                      |
      bases.VectorBased --+
                          |
          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. |
to3llh(self) Convert this n-vector to (geodetic) lat-, longitude and height. |
to4xyzh(self) 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) 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`, `minus`, `negate`, `others`, `parse`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `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
| H = ``'````'`` Heigth prefix (string), '↑' in JS version

Properties
| h Get the height above surface (meter).
Inherited from `vector3d.Vector3d`: `crosserrors`, `length`, `x`, `y`, `z` Inherited from `bases.Named`: `classname`, `classnaming`, `name` 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 (string). 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: bases.Named.copy

### to3llh(self) |
Convert this n-vector to (geodetic) lat-, longitude and height. Returns: 3-Tuple (lat, lon, height) in (degrees90, degrees180, meter).

### to4xyzh(self) |
Return this n-vector as a 4-tuple. Returns: 4-Tuple (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 (string). `sep` - Optional separator between components (string). Returns: Comma-separated "x, y, z [, h]" (string). Overrides: bases.Based.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) |
Normalize this vector to unit length. 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.