Algebra#

Extrapolation#

colour

Extrapolator([interpolator, method, left, ...])

Extrapolate 1-D function values beyond the specified interpolator's domain boundaries.

Interpolation#

colour

KernelInterpolator(x, y[, window, kernel, ...])

Perform kernel-based interpolation of a 1-D function.

LinearInterpolator(x, y[, dtype])

Perform linear interpolation of a 1-D function.

NearestNeighbourInterpolator(*args, **kwargs)

Perform nearest-neighbour interpolation on discrete data.

NullInterpolator(x, y[, absolute_tolerance, ...])

Implement 1-D function null interpolation.

PchipInterpolator(x, y, *args, **kwargs)

Interpolate a 1-D function using Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) interpolation.

SpragueInterpolator(x, y[, dtype])

Perform fifth-order polynomial interpolation using the Sprague (1880) method for uniformly spaced data.

lagrange_coefficients(r[, n])

Compute Lagrange coefficients at specified point \(r\) for polynomial interpolation of degree \(n\).

table_interpolation(V_xyz, table[, method])

Perform interpolation of the specified \(V_{xyz}\) values using a 4-dimensional interpolation table.

TABLE_INTERPOLATION_METHODS

Supported table interpolation methods.

Interpolation Kernels

colour

kernel_cardinal_spline(x[, a, b])

Return the cardinal spline kernel evaluated at specified samples.

kernel_lanczos(x[, a])

Return the Lanczos kernel evaluated at specified samples.

kernel_linear(x)

Evaluate the linear kernel at specified samples.

kernel_nearest_neighbour(x)

Return the nearest-neighbour kernel evaluated at specified samples.

kernel_sinc(x[, a])

Evaluate the sinc kernel at specified sample positions.

Ancillary Objects

colour.algebra

table_interpolation_tetrahedral(V_xyz, table)

Perform tetrahedral interpolation of the specified \(V_{xyz}\) values using the specified 4-dimensional interpolation table.

table_interpolation_trilinear(V_xyz, table)

Perform trilinear interpolation of the specified \(V_{xyz}\) values using the specified interpolation table.

Coordinates#

colour.algebra

cartesian_to_cylindrical(a)

Transform specified cartesian coordinates array \(xyz\) to cylindrical coordinates array \(\rho\phi z\) (radial distance, azimuth and height).

cartesian_to_polar(a)

Transform specified cartesian coordinates array \(xy\) to polar coordinates array \(\rho\phi\) (radial coordinate, angular coordinate).

cartesian_to_spherical(a)

Transform specified cartesian coordinates array \(xyz\) to spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth).

cylindrical_to_cartesian(a)

Transform specified cylindrical coordinates array \(\rho\phi z\) (radial distance, azimuth and height) to cartesian coordinates array \(xyz\).

polar_to_cartesian(a)

Transform specified polar coordinates array \(\rho\phi\) (radial coordinate, angular coordinate) to Cartesian coordinates array \(xy\).

spherical_to_cartesian(a)

Transform specified spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth) to cartesian coordinates array \(xyz\).

Random#

colour.algebra

random_triplet_generator(size[, limits, ...])

Generate random triplets using a pseudo-random number generator.

Regression#

colour.algebra

least_square_mapping_MoorePenrose(y, x)

Compute the least-squares mapping from dependent variable \(y\) to independent variable \(x\) using Moore-Penrose inverse.

Common#

colour.algebra

eigen_decomposition(a[, eigen_w_v_count, ...])

Compute the eigenvalues \(w\) and eigenvectors \(v\) of the specified array \(a\) in the specified order.

euclidean_distance(a, b)

Calculate the Euclidean distance between the specified point arrays \(a\) and \(b\).

get_sdiv_mode()

Return the current Colour safe division mode.

is_identity(a)

Determine whether the specified array \(a\) is an identity matrix.

is_spow_enabled()

Return whether Colour safe / symmetrical power function is enabled.

lerp(x[, a, b, clip])

Perform linear interpolation between specified arrays \(a\) and \(b\) using array \(x\).

linear_conversion(a, old_range, new_range)

Perform simple linear conversion of the specified array \(a\) between the old and new ranges.

linstep_function(x[, a, b, clip])

Perform linear interpolation between specified arrays \(a\) and \(b\) using array \(x\).

manhattan_distance(a, b)

Compute the Manhattan (or City-Block) distance between point array \(a\) and point array \(b\).

normalise_maximum(a[, axis, factor, clip])

Normalise specified array \(a\) values by \(a\) maximum value and optionally clip them between [0, factor].

normalise_vector(a)

Normalise the specified vector \(a\).

sdiv(a, b)

Perform safe division of array \(a\) by array \(b\) while handling zero-division cases.

sdiv_mode([mode])

Context manager and decorator for temporarily modifying Colour safe division function mode.

set_sdiv_mode(mode)

Set the Colour safe division function mode.

set_spow_enable(enable)

Set the Colour safe/symmetrical power function enabled state.

smooth(x[, a, b, clip])

Apply the smoothstep cubic Hermite interpolation function to array \(x\).

smoothstep_function(x[, a, b, clip])

Apply the smoothstep cubic Hermite interpolation function to array \(x\).

spow(...)

Raise specified array \(a\) to the power \(p\) as follows: \(\text{sign}(a) \cdot |a|^p\).

spow_enable(enable)

Context manager and decorator for temporarily setting the state of Colour safe/symmetrical power function.

vecmul(m, v)

Perform batched multiplication between the matrix array \(m\) and vector array \(v\).