colour.algebra.normalise_vector#
- colour.algebra.normalise_vector(a: ArrayLike) NDArrayFloat[source]#
Normalise the specified vector \(a\).
The normalisation process scales the vector to have unit length, ensuring that the magnitude of the resulting vector equals 1.
- Parameters:
a (ArrayLike) – Vector \(a\) to normalise.
- Returns:
Normalised vector \(a\) with unit length.
- Return type:
Examples
>>> a = np.array([0.20654008, 0.12197225, 0.05136952]) >>> normalise_vector(a) array([ 0.8419703..., 0.4972256..., 0.2094102...])