pub trait Points2 {
type Output;
Show 16 methods
// Required methods
fn x(&self) -> f64;
fn y(&self) -> f64;
fn with_x(&self, x: f64) -> Self::Output;
fn with_y(&self, y: f64) -> Self::Output;
fn to_polar(&self) -> PolarPoint;
fn magnitude(&self) -> f64;
fn magnitude_squared(&self) -> f64;
fn distance_from_origin(&self) -> f64;
fn distance_from_point(&self, other: &Self) -> f64;
fn dot(&self, other: &Self) -> f64;
fn rotate(&self, alpha: &f64) -> Self::Output;
fn unit(&self) -> Self::Output;
fn zero() -> Self::Output;
fn identity() -> Self::Output;
fn i_hat() -> Self::Output;
fn j_hat() -> Self::Output;
}Expand description
§Points Traits
Overloading of +-*/, as well as helper functions Traits specific to Points2
Required Associated Types§
Required Methods§
Sourcefn to_polar(&self) -> PolarPoint
fn to_polar(&self) -> PolarPoint
Converts Point2 to PolarPoint
Sourcefn magnitude_squared(&self) -> f64
fn magnitude_squared(&self) -> f64
Returns squared magnitude of vector
Sourcefn distance_from_origin(&self) -> f64
fn distance_from_origin(&self) -> f64
Returns distance from point to origin
Sourcefn distance_from_point(&self, other: &Self) -> f64
fn distance_from_point(&self, other: &Self) -> f64
Returns distance from one point to another
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.