Struct cavalier_contours::core::math::Vector2
source · pub struct Vector2<T = f64> {
pub x: T,
pub y: T,
}
Fields§
§x: T
§y: T
Implementations§
source§impl<T> Vector2<T>where
T: Real,
impl<T> Vector2<T>where T: Real,
sourcepub fn perp_dot(&self, other: Self) -> T
pub fn perp_dot(&self, other: Self) -> T
Compute the perpendicular dot product (self.x * other.y - self.y * other.x
).
sourcepub fn length_squared(&self) -> T
pub fn length_squared(&self) -> T
Squared length of the vector.
sourcepub fn fuzzy_eq_eps(&self, other: Self, fuzzy_epsilon: T) -> bool
pub fn fuzzy_eq_eps(&self, other: Self, fuzzy_epsilon: T) -> bool
Fuzzy equal comparison with another vector using fuzzy_epsilon
given.
sourcepub fn fuzzy_eq(&self, other: Self) -> bool
pub fn fuzzy_eq(&self, other: Self) -> bool
Fuzzy equal comparison with another vector using T::fuzzy_epsilon().
sourcepub fn rotate_about(&self, origin: Self, angle: T) -> Self
pub fn rotate_about(&self, origin: Self, angle: T) -> Self
Rotate this point around an origin
point by some angle
in radians.