[−][src]Struct triangulation::geom::Point
2D point represented by x and y coordinates
Fields
x: f32
y: f32
Methods
impl Point
[src]
pub fn new(x: f32, y: f32) -> Point
[src]
Creates a new point
pub fn distance_sq(self, other: Point) -> f32
[src]
Returns square of the distance between self
and other
point
Examples
let a = Point::new(10.0, 10.0); let b = Point::new(10.0, 110.0); assert!((a.distance_sq(b) - 10000.0) < 1e-6);
pub fn approx_eq(self, other: Point) -> bool
[src]
Returns true if points are approximately equal
Examples
let a = Point::new(10.0, 10.0); let b = Point::new(10.0, 10.0000001); assert!(a.approx_eq(b))
Trait Implementations
impl Clone for Point
[src]
fn clone(&self) -> Point
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Into<(i32, i32)> for Point
[src]
impl Into<(f32, f32)> for Point
[src]
impl Copy for Point
[src]
impl PartialOrd<Point> for Point
[src]
fn partial_cmp(&self, other: &Point) -> Option<Ordering>
[src]
fn lt(&self, other: &Point) -> bool
[src]
fn le(&self, other: &Point) -> bool
[src]
fn gt(&self, other: &Point) -> bool
[src]
fn ge(&self, other: &Point) -> bool
[src]
impl PartialEq<Point> for Point
[src]
impl Debug for Point
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,