Struct rasterize::Point[][src]

pub struct Point(pub [Scalar; 2]);

Value representing a 2D point or vector.

Implementations

impl Point[src]

pub fn new(x: Scalar, y: Scalar) -> Self[src]

pub fn x(self) -> Scalar[src]

Get x component of the point

pub fn y(self) -> Scalar[src]

Get y compenent of the point

pub fn length(self) -> Scalar[src]

Get length of the vector (distance from the origin)

pub fn dist(self, other: Self) -> Scalar[src]

Distance between two points

pub fn dot(self, other: Self) -> Scalar[src]

Dot product between two vectors

pub fn cross(self, other: Self) -> Scalar[src]

Cross product between two vectors

pub fn normal(self) -> Point[src]

Get vector normal (not a unit sized)

pub fn normalize(self) -> Option<Point>[src]

Convert vector to a unit size vector, if length is not zero

pub fn angle_between(self, other: Self) -> Option<Scalar>[src]

Calculate angle (from self to the other) between two vectors

pub fn cos_between(self, other: Self) -> Option<Scalar>[src]

Cosine of the angle (from self to the other) between to vectors

pub fn sin_between(self, other: Self) -> Option<Scalar>[src]

Sine of the angle (from self to the other) between to vectors

pub fn is_close_to(self, other: Point) -> bool[src]

Determine if self is close to the other within the marging of error (EPSILON)

Trait Implementations

impl Add<Point> for Point[src]

type Output = Point

The resulting type after applying the + operator.

impl Clone for Point[src]

impl Copy for Point[src]

impl Debug for Point[src]

impl Div<f64> for Point[src]

type Output = Point

The resulting type after applying the / operator.

impl<'a> From<&'a Point> for Point[src]

impl From<(f64, f64)> for Point[src]

impl Mul<&'_ Point> for Scalar[src]

type Output = Point

The resulting type after applying the * operator.

impl Mul<Point> for Scalar[src]

type Output = Point

The resulting type after applying the * operator.

impl Mul<Point> for Point[src]

type Output = Point

The resulting type after applying the * operator.

impl PartialEq<Point> for Point[src]

impl StructuralPartialEq for Point[src]

impl Sub<Point> for Point[src]

type Output = Point

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Point

impl Send for Point

impl Sync for Point

impl Unpin for Point

impl UnwindSafe for Point

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.