# Algebra¶

## Extrapolation¶

colour

 Extrapolator([interpolator, method, left, …]) Extrapolates the 1-D function of given interpolator.

## Interpolation¶

colour

 KernelInterpolator(x, y[, window, kernel, …]) Kernel based interpolation of a 1-D function. NearestNeighbourInterpolator(*args, **kwargs) A nearest-neighbour interpolator. LinearInterpolator(x, y[, dtype]) Linearly interpolates a 1-D function. NullInterpolator(x, y[, absolute_tolerance, …]) Performs 1-D function null interpolation, i.e. PchipInterpolator(x, y, *args, **kwargs) Interpolates a 1-D function using Piecewise Cubic Hermite Interpolating Polynomial interpolation. SpragueInterpolator(x, y[, dtype]) Constructs a fifth-order polynomial that passes through $$y$$ dependent variable. lagrange_coefficients(r[, n]) Computes the Lagrange Coefficients at given point $$r$$ for degree $$n$$. TABLE_INTERPOLATION_METHODS Supported table interpolation methods. table_interpolation(V_xyz, table[, method]) Performs interpolation of given $$V_{xyz}$$ values using given interpolation table.

Interpolation Kernels

colour

 kernel_nearest_neighbour(x) Returns the nearest-neighbour kernel evaluated at given samples. kernel_linear(x) Returns the linear kernel evaluated at given samples. kernel_sinc(x[, a]) Returns the sinc kernel evaluated at given samples. kernel_lanczos(x[, a]) Returns the lanczos kernel evaluated at given samples. kernel_cardinal_spline(x[, a, b]) Returns the cardinal spline kernel evaluated at given samples.

Ancillary Objects

colour.algebra

 table_interpolation_trilinear(V_xyz, table) Performs trilinear interpolation of given $$V_{xyz}$$ values using given interpolation table. table_interpolation_tetrahedral(V_xyz, table) Performs tetrahedral interpolation of given $$V_{xyz}$$ values using given interpolation table.

## Coordinates¶

colour.algebra

 cartesian_to_spherical(a) Transforms given Cartesian coordinates array $$xyz$$ to Spherical coordinates array $$\rho\theta\phi$$ (radial distance, inclination or elevation and azimuth). spherical_to_cartesian(a) Transforms given Spherical coordinates array $$\rho\theta\phi$$ (radial distance, inclination or elevation and azimuth) to Cartesian coordinates array $$xyz$$. cartesian_to_polar(a) Transforms given Cartesian coordinates array $$xy$$ to Polar coordinates array $$\rho\phi$$ (radial coordinate, angular coordinate). polar_to_cartesian(a) Transforms given Polar coordinates array $$\rho\phi$$ (radial coordinate, angular coordinate) to Cartesian coordinates array $$xy$$. cartesian_to_cylindrical(a) Transforms given Cartesian coordinates array $$xyz$$ to Cylindrical coordinates array $$\rho\phi z$$ (azimuth, radial distance and height). cylindrical_to_cartesian(a) Transforms given Cylindrical coordinates array $$\rho\phi z$$ (azimuth, radial distance and height) to Cartesian coordinates array $$xyz$$.

## Geometry¶

colour.algebra

 normalise_vector(a) Normalises given vector $$a$$. euclidean_distance(a, b) Returns the euclidean distance between point arrays $$a$$ and $$b$$. extend_line_segment(a, b[, distance]) Extends the line segment defined by point arrays $$a$$ and $$b$$ by given distance and return the new end point. intersect_line_segments(l_1, l_2) Computes $$l_1$$ line segments intersections with $$l_2$$ line segments. ellipse_coefficients_general_form(coefficients) Returns the general form ellipse coefficients from given canonical form ellipse coefficients. ellipse_coefficients_canonical_form(coefficients) Returns the canonical form ellipse coefficients from given general form ellipse coefficients. point_at_angle_on_ellipse(phi, coefficients) Returns the coordinates of the point at angle $$\phi$$ in degrees on the ellipse with given canonical form coefficients. ELLIPSE_FITTING_METHODS Supported ellipse fitting methods. ellipse_fitting(a[, method]) Returns the coefficients of the implicit second-order polynomial/quadratic curve that fits given point array $$a$$ using given method.

Ancillary Objects

colour.algebra

 LineSegmentsIntersections_Specification Defines the specification for intersection of line segments $$l_1$$ and $$l_2$$ returned by colour.algebra.intersect_line_segments() definition. ellipse_fitting_Halir1998(a) Returns the coefficients of the implicit second-order polynomial/quadratic curve that fits given point array $$a$$ using Halir and Flusser (1998) method.

## Matrix¶

colour.algebra

 is_identity(a[, n]) Returns if $$a$$ array is an identity matrix.

## Random¶

colour.algebra

 random_triplet_generator(size[, limits, …]) Returns a generator yielding random triplets.

## Regression¶

colour.algebra

 least_square_mapping_MoorePenrose(y, x) Computes the least-squares mapping from dependent variable $$y$$ to independent variable $$x$$ using Moore-Penrose inverse.

## Common¶

colour.algebra

 is_spow_enabled() Returns whether Colour safe / symmetrical power function is enabled. set_spow_enable(enable) Sets Colour safe / symmetrical power function enabled state. spow_enable(enable) A context manager and decorator temporarily setting Colour safe / symmetrical power function enabled state. spow(a, p) Raises given array $$a$$ to the power $$p$$ as follows: $$sign(a) * |a|^p$$.