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

# Module vector3d

Generic 3-D vector base class Vector3d and function sumOf.

Pure Python implementation of vector-based functions by (C) Chris Veness 2011-2015 published under the same MIT Licence**, see Vector-based geodesy.

Version: 20.08.12

Classes
| VectorError Vector3d or `*Nvector` issue.
| Vector3d Generic 3-D vector manipulation.

Functions
intersections2(center1, radius1, center2, radius2, sphere=True, Vector=None, **Vector_kwds) Compute the intersection of two spheres or circles, each defined by a center point and a radius. |
parse3d(str3d, sep=`'``,``'`, name=`'````'`, Vector=<class 'pygeodesy.vector3d.Vector3d'>, **Vector_kwds) Parse an `"x, y, z"` string. |
sumOf(vectors, Vector=<class 'pygeodesy.vector3d.Vector3d'>, **Vector_kwds) Compute the vectorial sum of several vectors. |

Variables
| __all__ = `_ALL_LAZY.vector3d`

Function Details

### intersections2 (center1, radius1, center2, radius2, sphere=True, Vector=None, **Vector_kwds) |
Compute the intersection of two spheres or circles, each defined by a center point and a radius. Arguments: `center1` - Center of the first sphere or circle (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `radius1` - Radius of the first sphere or circle (same units as the `center1` coordinates). `center2` - Center of the second sphere or circle (Vector3d, `Vector3Tuple` or `Vector4Tuple`). `radius2` - Radius of the second sphere or circle (same units as the `center1` and `center2` coordinates). `sphere` - If `True` compute the center and radius of the intersection of two spheres. If `False`, ignore the `z`-component and compute the intersection of two circles (`bool`). `Vector` - Class to return intersections (Vector3d or `Vector3Tuple`) or `None` for Vector3d. `Vector_kwds` - Optional, additional `Vector` keyword arguments, ignored if `Vector=None`. Returns: 2-Tuple of the `center` and `radius` of the intersection of the spheres if `sphere` is `True`. The `radius` is `0.0` for abutting spheres. Otherwise, a 2-tuple of the intersection points of two circles. For abutting circles, both intersection points are the same `Vector` instance. Raises: `IntersectionError` - Concentric, invalid or non-intersecting spheres or circles. `UnitError` - Invalid `radius1` or `radius2`. See Also: Sphere-Sphere and circle-circle intersections.

### parse3d (str3d, sep=`'``,``'`, name=`'````'`, Vector=<class 'pygeodesy.vector3d.Vector3d'>, **Vector_kwds) |
Parse an `"x, y, z"` string. Arguments: `str3d` - X, y and z values (`str`). `sep` - Optional separator (`str`). `name` - Optional instance name (`str`). `Vector` - Optional class (Vector3d). `Vector_kwds` - Optional `Vector` keyword arguments, ignored if `Vector=None`. Returns: New `Vector` or if `Vector` is `None`, a Vector3Tuple`(x, y, z)`. Raises: `VectorError` - Invalid `str3d`.

### sumOf (vectors, Vector=<class 'pygeodesy.vector3d.Vector3d'>, **Vector_kwds) |
Compute the vectorial sum of several vectors. Arguments: `vectors` - Vectors to be added (Vector3d[]). `Vector` - Optional class for the vectorial sum (Vector3d). `Vector_kwds` - Optional `Vector` keyword arguments, ignored if `Vector=None`. Returns: Vectorial sum as `Vector` or if `Vector` is `None`, a Vector3Tuple`(x, y, z)`. Raises: `VectorError` - No `vectors`.