Struct flo_canvas::Coord2
source · pub struct Coord2(pub f64, pub f64);
Expand description
Represents a 2D point
Tuple Fields§
§0: f64
§1: f64
Trait Implementations§
source§impl Coordinate for Coord2
impl Coordinate for Coord2
source§fn from_components(components: &[f64]) -> Coord2
fn from_components(components: &[f64]) -> Coord2
Creates a new coordinate from the specified set of components
source§fn from_biggest_components(p1: Coord2, p2: Coord2) -> Coord2
fn from_biggest_components(p1: Coord2, p2: Coord2) -> Coord2
Returns a point made up of the biggest components of the two points
source§fn from_smallest_components(p1: Coord2, p2: Coord2) -> Coord2
fn from_smallest_components(p1: Coord2, p2: Coord2) -> Coord2
Returns a point made up of the smallest components of the two points
source§fn distance_to(&self, target: &Coord2) -> f64
fn distance_to(&self, target: &Coord2) -> f64
Computes the distance between this coordinate and another of the same type
source§fn dot(&self, target: &Coord2) -> f64
fn dot(&self, target: &Coord2) -> f64
Computes the dot product for this vector along with another vector
source§fn to_unit_vector(&self) -> Self
fn to_unit_vector(&self) -> Self
Treating this as a vector, returns a unit vector in the same direction
source§fn round(self, accuracy: f64) -> Self
fn round(self, accuracy: f64) -> Self
Round this coordinate so that it is accurate to a certain precision
source§impl Coordinate2D for Coord2
impl Coordinate2D for Coord2
source§impl PartialEq<Coord2> for Coord2
impl PartialEq<Coord2> for Coord2
impl Copy for Coord2
impl StructuralPartialEq for Coord2
Auto Trait Implementations§
impl RefUnwindSafe for Coord2
impl Send for Coord2
impl Sync for Coord2
impl Unpin for Coord2
impl UnwindSafe for Coord2
Blanket Implementations§
source§impl<T> Coordinate2DExt for Twhere
T: Coordinate + Coordinate2D,
impl<T> Coordinate2DExt for Twhere T: Coordinate + Coordinate2D,
source§fn unit_vector_at_angle(radians: impl Into<f64>) -> T
fn unit_vector_at_angle(radians: impl Into<f64>) -> T
Creates a unit vector at an angle in radians measured from the x-axis
source§impl<T> CoordinateExt for Twhere
T: Coordinate,
impl<T> CoordinateExt for Twhere T: Coordinate,
source§fn unit_vector() -> T
fn unit_vector() -> T
Creates a unit vector along the x axis