Struct s2::r3::vector::Vector[][src]

pub struct Vector {
    pub x: f64,
    pub y: f64,
    pub z: f64,
}

Vector represents a point in ℝ³.

Fields

Methods

impl Vector
[src]

approx_eq reports whether v and ov are equal within a small epsilon.

norm returns the vector's norm.

norm2 returns the square of the norm.

normalize returns a unit vector in the same direction as v.

dot returns the standard dot product of v and ov.

is_unit returns whether this vector is of approximately unit length.

abs returns the vector with nonnegative components.

cross returns the standard cross product of v and ov.

distance returns the Euclidean distance between v and ov.

angle returns the angle between v and ov.

ortho returns a unit vector that is orthogonal to v. ortho(-v) = -ortho(v) for all v.

largest_component returns the axis that represents the largest component in this vector.

smallest_component returns the axis that represents the smallest component in this vector.

Trait Implementations

impl Clone for Vector
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Vector
[src]

impl PartialEq for Vector
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Vector
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for Vector
[src]

Formats the value using the given formatter. Read more

impl Add<Vector> for Vector
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, 'b> Add<&'b Vector> for &'a Vector
[src]

The resulting type after applying the + operator.

add returns the standard vector sum of v and ov.

impl Sub<Vector> for Vector
[src]

The resulting type after applying the - operator.

sub returns the standard vector difference of v and ov.

impl<'a, 'b> Sub<&'b Vector> for &'a Vector
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Mul<Vector> for Vector
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b> Mul<&'a Vector> for &'b Vector
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<f64> for &'a Vector
[src]

The resulting type after applying the * operator.

mul returns the standard scalar product of v and m.

impl Mul<f64> for Vector
[src]

The resulting type after applying the * operator.

Performs the * operation.

Auto Trait Implementations

impl Send for Vector

impl Sync for Vector