Trait Projective

Source
pub trait Projective:
    From<Vector4<f64>>
    + Clone
    + Copy {
    // Required method
    fn homogeneous(self) -> Vector4<f64>;

    // Provided methods
    fn point(self) -> Option<Point3<f64>> { ... }
    fn from_point(point: Point3<f64>) -> Self { ... }
    fn bearing(self) -> Unit<Vector3<f64>> { ... }
    fn bearing_unnormalized(self) -> Vector3<f64> { ... }
}
Expand description

This trait is implemented for homogeneous projective 3d coordinate.

Required Methods§

Source

fn homogeneous(self) -> Vector4<f64>

Retrieve the homogeneous vector.

No constraints are put on this vector. All components can move freely and it is not normalized. However, this vector may be normalized if desired and it will still be equivalent to the original. You may wish to normalize it if you want to avoid floating point precision issues, for instance.

Provided Methods§

Source

fn point(self) -> Option<Point3<f64>>

Retrieve the euclidean 3d point by normalizing the homogeneous coordinate.

This may fail, as a homogeneous coordinate can exist at near-infinity (like a star in the sky), whereas a 3d euclidean point cannot (it would overflow).

Source

fn from_point(point: Point3<f64>) -> Self

Convert the euclidean 3d point into homogeneous coordinates.

Source

fn bearing(self) -> Unit<Vector3<f64>>

Retrieve the normalized bearing of the coordinate.

Source

fn bearing_unnormalized(self) -> Vector3<f64>

Retrieve the unnormalized bearing of the coordinate.

Use this when you know that you do not need the bearing to be normalized, and it may increase performance. Otherwise use Projective::bearing.

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.

Implementors§