shadow4.tools.arrayofvectors

Operations on arrays of 3D vectors with shape (n_vectors, 3).

Each function operates element-wise over a batch of vectors so that an entire ray bundle can be transformed in a single NumPy call. All inputs and outputs follow the convention v[n_vectors, 3] unless otherwise stated.

Functions

vector_add_scalar(u, k)

Calculate the sum of a vector and a scalar constant.

vector_cross(u, v)

Calculate the vector cross product.

vector_default_efields(DIREC[, pol_deg])

Creates two unitary vectors pointing on a sigma and pi-polarization directions.

vector_diff(u, v)

Calculate the difference of two vectors u - v.

vector_dot(u, v)

Calculate the dot product of two vectors.

vector_modulus(u)

Calculates the modulus of a vector array.

vector_modulus_square(u)

Calculates the modulus of a vector array to the power 2.

vector_multiply_scalar(u, k)

Calculate the product of a vector by a scalar.

vector_norm(u)

Calculate the normalized vector.

vector_reflection(v1, normal)

Calculate the reflection of a vector (ray) on a surface.

vector_refraction(vin, normal, n1, n2[, ...])

Calculate the refraction (transmission) vector using Snell's Law in vector form.

vector_rotate_around_axis(u, rotation_axis, ...)

Rotates the vector around an axis.

vector_scattering(K_IN, H, NORMAL)

Calculate the scattering of a wavevector.

vector_sum(u, v)

Calculate the sum of two vectors.