desdeo_emo.utilities.symmetric_vectors

Module Contents

Functions

shear(vectors[, degrees])

Shear a set of vectors lying on the plane z=0 towards the z-axis, such that the

normalize(vectors)

Normalize a set of vectors.

rotate(initial_vector, rotated_vector, other_vectors)

Calculate the rotation matrix that rotates the initial_vector to the

householder(vector)

Return reflection matrix via householder transformation.

rotate_toward(initial_vector, final_vector, other_vectors)

Rotate other_vectors (with the centre at initial_vector) towards final_vector

main()

desdeo_emo.utilities.symmetric_vectors.shear(vectors, degrees: float = 5)[source]

Shear a set of vectors lying on the plane z=0 towards the z-axis, such that the resulting vectors ‘degrees’ angle away from the z axis.

z is the last element of the vector, and has to be equal to zero.

Parameters:
  • vectors (numpy.ndarray) – The final element of each vector should be zero.

  • degrees (float, optional) – The angle that the resultant vectors make with the z axis. Unit is radians. (the default is 5)

desdeo_emo.utilities.symmetric_vectors.normalize(vectors)[source]

Normalize a set of vectors.

The length of the returned vectors will be unity.

Parameters:

vectors (np.ndarray) – Set of vectors of any length, except zero.

desdeo_emo.utilities.symmetric_vectors.rotate(initial_vector, rotated_vector, other_vectors)[source]

Calculate the rotation matrix that rotates the initial_vector to the rotated_vector. Apply that rotation on other_vectors and return. Uses Householder reflections twice to achieve this.

desdeo_emo.utilities.symmetric_vectors.householder(vector)[source]

Return reflection matrix via householder transformation.

desdeo_emo.utilities.symmetric_vectors.rotate_toward(initial_vector, final_vector, other_vectors, degrees: float = 5)[source]

Rotate other_vectors (with the centre at initial_vector) towards final_vector by an angle degrees.

Parameters:
  • initial_vector (np.ndarray) – Centre of the vectors to be rotated.

  • final_vector (np.ndarray) – The final position of the center of other_vectors.

  • other_vectors (np.ndarray) – The array of vectors to be rotated

  • degrees (float, optional) – The amount of rotation (the default is 5)

Returns:

  • rotated_vectors (np.ndarray) – The rotated vectors

  • reached (bool) – True if final_vector has been reached

desdeo_emo.utilities.symmetric_vectors.main()[source]