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

Class Vector3d

       object --+            
                |            
     named._Named --+        
                    |        
     named._NamedBase --+    
                        |    
vector3dBase.Vector3dBase --+
                            |
                           Vector3d
Known Subclasses:

Extended 3-D vector.

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

Instance Methods
 
iscolinearWith(self, point1, point2, eps=2.22044604925e-16)
Check whether this and two other points are colinear.
 
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.
 
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, cmp, cross, dividedBy, dot, equals, isequalTo, minus, negate, others, plus, rotate, rotateAround, sum, 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, xyz, y, z

Inherited from named._Named: classname, classnaming, name, named, named2, named3, named4

Inherited from object: __class__

Method Details

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.

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 - If other1 or other2 is not Vector3d.

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:

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.