Package lib :: Package geometry :: Module vectors
[hide private]
[frames] | no frames]

Module vectors

source code

Collection of functions for vector operations.

Functions [hide private]
 
random_unit_vector(vector)
Generate a random rotation axis.
source code
numpy float64 array
unit_vector_from_2point(point1, point2)
Generate the unit vector connecting point 1 to point 2.
source code
Variables [hide private]
  __package__ = 'lib.geometry'

Imports: acos, cos, pi, sin, array, float64, norm, uniform


Function Details [hide private]

random_unit_vector(vector)

source code 

Generate a random rotation axis.

Uniform point sampling on a unit sphere is used to generate a random axis orientation.

Parameters:
  • vector (numpy 3D, rank-1 array) - The 3D rotation axis.

unit_vector_from_2point(point1, point2)

source code 

Generate the unit vector connecting point 1 to point 2.

Parameters:
  • point1 (list of float or numpy array) - The first point.
  • point2 (list of float or numpy array) - The second point.
Returns: numpy float64 array
The unit vector.