maths

Simple vector and matrix maths.

skysegmentor.vector_norm(a)[source]

Returns the magnitude a vector.

Parameters:

a (array) – Vector a.

skysegmentor.vector_dot(a, b)[source]

Returns the vector dot product.

Parameters:
  • a (array) – Vector a.

  • b (array) – Vector b.

skysegmentor.vector_cross(a, b)[source]

Returns the vector cross product.

Parameters:
  • a (array) – Vector a.

  • b (array) – Vector b.

Returns:

s – Cross product vector.

Return type:

array

skysegmentor.matrix_dot_3by3(mat1, mat2)[source]

Dot product of 2 3x3 matrices.

Parameters:
  • mat1 (array) – Flattened 3by3 matrices.

  • mat2 (array) – Flattened 3by3 matrices.

Returns:

mat3 – Matrix dot product output.

Return type:

array