pub type Point = Vector;
Expand description
Alias for vector to distinguish intended use.
Aliased Type§
struct Point {
pub x: f32,
pub y: f32,
}
Fields§
§x: f32
§y: f32
Implementations
Source§impl Vector
impl Vector
Sourcepub fn length_squared(self) -> f32
pub fn length_squared(self) -> f32
Returns the squared length of the vector.
Sourcepub fn distance_to(self, other: Self) -> f32
pub fn distance_to(self, other: Self) -> f32
Returns the distance between two points.
Sourcepub fn ceil(self) -> Self
pub fn ceil(self) -> Self
Returns a new vector containing the smallest integer values greater than or equal to each component.
Sourcepub fn floor(self) -> Self
pub fn floor(self) -> Self
Returns a new vector containing the largest integer values less than or equal to each component.
Sourcepub fn nearly_eq(self, other: Vector) -> bool
pub fn nearly_eq(self, other: Vector) -> bool
Returns true if this vector is approximately equal to other using a standard single precision epsilon value.
Sourcepub fn nearly_eq_by(self, other: Vector, epsilon: f32) -> bool
pub fn nearly_eq_by(self, other: Vector, epsilon: f32) -> bool
Returns true if this vector is approximately equal to other using the specified epsilon value.