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 (3-D) points. |
iscolinearWith(self, point1, point2, eps=2.22044604925e-16) Check whether this and two other (3-D) points are colinear. |
jekel4_(self, *points) Best-fit a sphere through this and one or more other (3-D) points. |
meeus2(self, point2, point3, circum=False) Return the radius and Meeus' Type of the smallest circle containing or through this and two other (3-D) points. |
nearestOn(self, point1, point2, 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 (3-D) points. Arguments: `point2` - Second point (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point3` - Third point (`Cartesian`, 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`, an instance of this (sub-)class, is coplanar with all three points. Raises: `ImportError` - Package `numpy` not found, not installed or older than version 1.10. `IntersectionError` - Near-concentric, coincident or colinear points or a trilateration or `numpy` issue. `TypeError` - Invalid `point2` or `point3`. See Also: Function `circum3` and methods `jekel4_` and `meeus2`.

### iscolinearWith (self, point1, point2, eps=2.22044604925e-16) |
Check whether this and two other (3-D) points are colinear. Arguments: `point1` - One point (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point2` - An other point (`Cartesian`, 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.

### jekel4_ (self, *points) |
Best-fit a sphere through this and one or more other (3-D) points. Arguments: `points` - Other points (each a `Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). Returns: Jekel4Tuple`(radius, center, rank, residuals)` with `center` an instance if this (sub-)class. Raises: `ImportError` - Package `numpy` not found, not installed or older than version 1.10. `NumPyError` - Some `numpy` issue. `TypeError` - One of the `points` invalid. `ValueError` - Too few `points`. See Also: Function `jekel4_` and methods circum3 and meeus2.

### meeus2 (self, point2, point3, circum=False) |
Return the radius and Meeus' Type of the smallest circle containing or through this and two other (3-D) points. Arguments: `point2` - Second point (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point3` - Third point (`Cartesian`, 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: Function `meeus2` and methods `circum3` and `jekel4_`.

### nearestOn (self, point1, point2, within=True) |
Locate the point between two points closest to this point. Arguments: `point1` - Start point (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `point2` - End point (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `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, either `point1` or `point2` or an instance of this (sub-)class. Raises: `TypeError` - Invalid `point1` or `point2`. 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 (`Cartesian`, Vector3d, `Vector2Tuple`, `Vector3Tuple` or `Vector4Tuple`). `radius2` - Radius of this circle (same `units` as this `x` and `y`. `center3` - Center of the 3rd circle (`Cartesian`, 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, an instance of this (sub-)class with `z=z`. 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 (`Cartesian`, Vector3d, `Vector3Tuple` or `Vector4Tuple`). `radius2` - Radius of this sphere (same `units` as this `x`, `y` and `z`). `center3` - Center of the 3rd sphere (`Cartesian`, , 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 (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.10. `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.10 or later. See Also: Norrdine, A. An Algebraic Solution to the Multilateration Problem and implementation.