[][src]Struct kas::geom::DVec2

#[repr(C)]pub struct DVec2(pub f64, pub f64);

2D vector (double precision)

Usually used as either a coordinate or a difference of coordinates, but may have some other uses.

Vectors are partially ordered and support component-wise comparison via methods like lhs.lt(rhs). The PartialOrd trait is not implemented since it implements lhs ≤ rhs as lhs < rhs || lhs == rhs which is wrong for vectors (consider for lhs = (0, 1), rhs = (1, 0)).

Implementations

impl DVec2[src]

pub const ZERO: DVec2[src]

Zero

pub const INFINITY: DVec2[src]

Positive infinity

pub const fn splat(value: f64) -> Self[src]

Constructs a new instance with each element initialized to value.

pub fn min_comp(self) -> f64[src]

Take the minimum component

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

Return the minimum, componentwise

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

Return the maximum, componentwise

pub fn abs(self) -> Self[src]

Take the absolute value of each component

pub fn ceil(self) -> Self[src]

Take the ceiling of each component

pub fn sign(self) -> Self[src]

For each component, return ±1 with the same sign as self.

pub fn lt(self, rhs: Self) -> bool[src]

True when for all components, lhs < rhs

pub fn le(self, rhs: Self) -> bool[src]

True when for all components, lhs ≤ rhs

pub fn ge(self, rhs: Self) -> bool[src]

True when for all components, lhs ≥ rhs

pub fn gt(self, rhs: Self) -> bool[src]

True when for all components, lhs > rhs

pub fn complex_mul(self, rhs: Self) -> Self[src]

Multiply two vectors as if they are complex numbers

pub fn complex_div(self, rhs: Self) -> Self[src]

Divide by a second vector as if they are complex numbers

pub fn complex_inv(self) -> Self[src]

Take the complex reciprocal

pub fn sum(self) -> f64[src]

Return the sum of the terms

pub fn sum_square(self) -> f64[src]

Return the sum of the square of the terms

Trait Implementations

impl Add<DVec2> for DVec2[src]

type Output = DVec2

The resulting type after applying the + operator.

impl Add<f64> for DVec2[src]

type Output = DVec2

The resulting type after applying the + operator.

impl Clone for DVec2[src]

impl Copy for DVec2[src]

impl Debug for DVec2[src]

impl Default for DVec2[src]

impl Div<DVec2> for DVec2[src]

type Output = DVec2

The resulting type after applying the / operator.

impl Div<f64> for DVec2[src]

type Output = DVec2

The resulting type after applying the / operator.

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

impl From<Coord> for DVec2[src]

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

impl From<DVec2> for Coord[src]

impl From<DVec2> for Size[src]

impl From<DVec2> for Vec2[src]

impl From<Size> for DVec2[src]

impl From<Vec2> for DVec2[src]

impl Mul<DVec2> for DVec2[src]

type Output = DVec2

The resulting type after applying the * operator.

impl Mul<f64> for DVec2[src]

type Output = DVec2

The resulting type after applying the * operator.

impl Neg for DVec2[src]

type Output = DVec2

The resulting type after applying the - operator.

impl PartialEq<DVec2> for DVec2[src]

impl StructuralPartialEq for DVec2[src]

impl Sub<DVec2> for DVec2[src]

type Output = DVec2

The resulting type after applying the - operator.

impl Sub<f64> for DVec2[src]

type Output = DVec2

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for DVec2

impl Send for DVec2

impl Sync for DVec2

impl Unpin for DVec2

impl UnwindSafe for DVec2

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.