[][src]Struct triangulation::geom::Point

pub struct Point {
    pub x: f32,
    pub y: f32,
}

2D point represented by x and y coordinates

Fields

x: f32y: 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 Into<(i32, i32)> for Point[src]

impl Into<(f32, f32)> for Point[src]

impl PartialEq<Point> for Point[src]

impl PartialOrd<Point> for Point[src]

impl Copy for Point[src]

impl Clone for Point[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Point[src]

Auto Trait Implementations

impl Send for Point

impl Sync for Point

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.