Package pygeodesy :: Module vector3d :: Class Vector3d |
[frames] | no frames]

# Class Vector3d

           object --+
                    |
         named._Named --+
                        |
         named._NamedBase --+
                            |
    vector3dBase.Vector3dBase --+
                                |
                               Vector3d

Known Subclasses:
  - ltpTuples.XyzLocal
  - , nvectorBase.NvectorBase
  - , cartesianBase.CartesianBase

Extended 3-D vector.

In a geodesy context, these may be used to represent:

- n-vector representing a normal to a point on earth's surface
- earth-centered, earth-fixed cartesian (ECEF)
- great circle normal to vector
- motion vector on earth's surface
- etc.

Instance Methods
circum3(self, point2, point3, circum=True, eps=8.881784197e-16) Return the radius and center of the smallest circle through or containing this and two other points. |
iscolinearWith(self, point1, point2, eps=2.22044604925e-16) Check whether this and two other points are colinear. |
meeus2(self, point2, point3, circum=False) Return the radius and Meeus' Type of the smallest containing or through this and two other points. |
nearestOn(self, other1, other2, within=True) Locate the point between two points closest to this point. |
parse(self, str3d, sep=',', name='') Parse an `"x, y, z"` string to a Vector3d instance. |
trilaterate2d2(self, radius, center2, radius2, center3, radius3, eps=2.22044604925e-16, z=0) Trilaterate this and two other circles, each given as a (2-D) center and a radius. |
trilaterate3d2(self, radius, center2, radius2, center3, radius3, eps=2.22044604925e-16) Trilaterate this and two other spheres, each given as a (3-D) center and a radius. |
Inherited from `vector3dBase.Vector3dBase`: `__abs__`, `__add__`, `__cmp__`, `__div__`, `__eq__`, `__ge__`, `__gt__`, `__init__`, `__le__`, `__lt__`, `__matmul__`, `__mul__`, `__ne__`, `__neg__`, `__pos__`, `__radd__`, `__rmatmul__`, `__rsub__`, `__sub__`, `__truediv__`, `angleTo`, `apply`, `cmp`, `cross`, `dividedBy`, `dot`, `equals`, `isconjugateTo`, `isequalTo`, `minus`, `negate`, `others`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `times_`, `to2ab`, `to2ll`, `to3xyz`, `toStr`, `unit` 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 `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

### circum3 (self, point2, point3, circum=True, eps=8.881784197e-16) |
Return the radius and center of the smallest circle through or containing this and two other points. Arguments: `point2` - Second point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point3` - Third point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `circum` - If `True` return the `circumradius` and `circumcenter`, always, ignoring the Meeus' Type I case (`bool`). `eps` - Tolerance passed to function trilaterate3d2. Returns: A Circum3Tuple`(radius, center, deltas)`. The `center` is coplanar with all three points. Raises: `ImportError` - Package `numpy` not found, not installed or older than version 1.15. `IntersectionError` - Near-concentric, coincident or colinear points or a trilateration or `numpy` issue. `TypeError` - Invalid `point2` or `point3`. See Also: Method `meeus2` and functions circum3 and meeus2.

### iscolinearWith (self, point1, point2, eps=2.22044604925e-16) |
Check whether this and two other points are colinear. Arguments: `point1` - One point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point2` - Another point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `eps` - Tolerance (`scalar`), same units as `x`, `y`, and `z`. Returns: `True` if this point is colinear with `point1` and `point2`, `False` otherwise. Raises: `TypeError` - Invalid `point1` or `point2`. See Also: Method nearestOn.

### meeus2 (self, point2, point3, circum=False) |
Return the radius and Meeus' Type of the smallest containing or through this and two other points. Arguments: `point2` - Second point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point3` - Third point (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `circum` - If `True` return the `circumradius` and `circumcenter` always, ignoring the Meeus' Type I case (`bool`). Returns: Meeus2Tuple`(radius, Type)`. Raises: `IntersectionError` - Coincident or colinear points, iff `circum=True`. `TypeError` - Invalid `point2` or `point3`. See Also: Method `circum3` and functions circum3 and meeus2.

### nearestOn (self, other1, other2, within=True) |
Locate the point between two points closest to this point. Arguments: `other1` - Start point (Vector3d). `other2` - End point (Vector3d). `within` - If `True` return the closest point between the given points, otherwise the closest point on the extended line through both points (`bool`). Returns: Closest point (Vector3d). Raises: `TypeError` - Invalid `other1` or `other2`. See Also: Method sphericalTrigonometry.LatLon.nearestOn3 and 3-D Point-Line distance.

### parse (self, str3d, sep=',', name='') |
Parse an `"x, y, z"` string to a Vector3d instance. Arguments: `str3d` - X, y and z string (`str`), see function parse3d. `sep` - Optional separator (`str`). `name` - Optional instance name (`str`), overriding this name. Returns: The instance (Vector3d). Raises: `VectorError` - Invalid `str3d`.

### trilaterate2d2 (self, radius, center2, radius2, center3, radius3, eps=2.22044604925e-16, z=0) |
Trilaterate this and two other circles, each given as a (2-D) center and a radius. Arguments: `radius` - Radius of this circle (same `units` as this `x` and `y`. `center2` - Center of the 2nd circle (Vector3d, `Vector2Tuple`, `Vector3Tuple` or `Vector4Tuple`). `radius2` - Radius of this circle (same `units` as this `x` and `y`. `center3` - Center of the 3rd circle (Vector3d, `Vector2Tuple`, `Vector3Tuple` or `Vector4Tuple`). `radius3` - Radius of the 3rd circle (same `units` as this `x` and `y`. `eps` - Check the trilaterated point delta on all 3 circles (`scalar`) or `None`. `z` - Optional Z component of the trilaterated point (`scalar`). Returns: Trilaterated point as a Vector3d`(x, y, z=z)` instance. Raises: `IntersectionError` - No intersection, colinear or near-concentric centers, trilateration failed some other way or the trilaterated point is off one circle by more than `eps`. `TypeError` - Invalid `center2` or `center3`. `UnitError` - Invalid `radius1`, `radius2` or `radius3`. See Also: Function trilaterate2d2.

### trilaterate3d2 (self, radius, center2, radius2, center3, radius3, eps=2.22044604925e-16) |
Trilaterate this and two other spheres, each given as a (3-D) center and a radius. Arguments: `radius` - Radius of this sphere (same `units` as this `x`, `y` and `z`). `center2` - Center of the 2nd sphere (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `radius2` - Radius of this sphere (same `units` as this `x`, `y` and `z`). `center3` - Center of the 3rd sphere (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `radius3` - Radius of the 3rd sphere (same `units` as this `x`, `y` and `z`). `eps` - Tolerance (`scalar`), same units as `x`, `y`, and `z`. Returns: 2-Tuple with two trilaterated points, each an instance of this Vector3d (sub-)class. Both points are the same instance if all three spheres intersect or abut in a single point. Raises: `ImportError` - Package `numpy` not found, not installed or older than version 1.15. `IntersectionError` - Near-concentric, colinear, too distant or non-intersecting spheres or `numpy` issue. `TypeError` - Invalid `center2` or `center3`. `UnitError` - Invalid `radius`, `radius2` or `radius3`. Note: Package numpy is required, version 1.15 or later. See Also: Norrdine, A. An Algebraic Solution to the Multilateration Problem and implementation.