pub trait Projective:
From<Matrix<f64, U4, U1, <DefaultAllocator as Allocator<f64, U4>>::Buffer>>
+ Clone
+ Copy {
// Required method
fn homogeneous(
self,
) -> Matrix<f64, U4, U1, <DefaultAllocator as Allocator<f64, U4>>::Buffer>;
// Provided methods
fn point(self) -> Option<Point<f64, U3>> { ... }
fn from_point(point: Point<f64, U3>) -> Self { ... }
fn bearing(
self,
) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>> { ... }
fn bearing_unnormalized(
self,
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer> { ... }
}
Expand description
This trait is implemented for homogeneous projective 3d coordinate.
Required Methods§
Sourcefn homogeneous(
self,
) -> Matrix<f64, U4, U1, <DefaultAllocator as Allocator<f64, U4>>::Buffer>
fn homogeneous( self, ) -> Matrix<f64, U4, U1, <DefaultAllocator as Allocator<f64, U4>>::Buffer>
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§
Sourcefn point(self) -> Option<Point<f64, U3>>
fn point(self) -> Option<Point<f64, U3>>
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).
Sourcefn from_point(point: Point<f64, U3>) -> Self
fn from_point(point: Point<f64, U3>) -> Self
Convert the euclidean 3d point into homogeneous coordinates.
Sourcefn bearing(
self,
) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>
fn bearing( self, ) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>
Retrieve the normalized bearing of the coordinate.
Sourcefn bearing_unnormalized(
self,
) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>
fn bearing_unnormalized( self, ) -> Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>
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.