pub trait ConversionTo<T: CoordinateSystem + 'static>: CoordinateSystem{
// Required method
fn convert_point(p: &Point<Self>) -> Point<T>;
// Provided methods
fn jacobian(p: &Point<Self>) -> Matrix<T> { ... }
fn inv_jacobian(
p: &Point<Self>,
) -> Tensor<T, (CovariantIndex, ContravariantIndex)> { ... }
}
Expand description
Trait used for conversions between different coordinate systems. Implementing ConversionTo<T>
for a CoordinateSystem
will allow objects in that system to be converted to the system T
(note that T
also has to be a CoordinateSystem
).
Required Methods§
Sourcefn convert_point(p: &Point<Self>) -> Point<T>
fn convert_point(p: &Point<Self>) -> Point<T>
Function converting the coordinates of a point.
Provided Methods§
Sourcefn jacobian(p: &Point<Self>) -> Matrix<T>
fn jacobian(p: &Point<Self>) -> Matrix<T>
Function calculating a Jacobian at a point - that is, the matrix of derivatives of the coordinate conversions.
This will be contracted with contravariant indices in the tensor.
Sourcefn inv_jacobian(
p: &Point<Self>,
) -> Tensor<T, (CovariantIndex, ContravariantIndex)>
fn inv_jacobian( p: &Point<Self>, ) -> Tensor<T, (CovariantIndex, ContravariantIndex)>
The inverse matrix of the Jacobian at a point.
In conversions, it will be contracted with covariant indices.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.