Struct acgmath::Vector3 [] [src]

#[repr(C)]
pub struct Vector3<S> { pub x: S, pub y: S, pub z: S, }

A 3-dimensional vector.

This type is marked as #[repr(C)].

Fields

The x component of the vector.

The y component of the vector.

The z component of the vector.

Methods

impl<S> Vector3<S>
[src]

Construct a new vector, using the provided values.

impl<S: NumCast + Copy> Vector3<S>
[src]

Component-wise casting to another type

impl<S: BaseNum> Vector3<S>
[src]

A unit vector in the x direction.

A unit vector in the y direction.

A unit vector in the w direction.

Returns the cross product of the vector and other.

Create a Vector4, using the x, y and z values from this vector, and the provided w.

Create a Vector2, dropping the z value.

Trait Implementations

impl<S: PartialEq> PartialEq for Vector3<S>
[src]

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

This method tests for !=.

impl<S: Eq> Eq for Vector3<S>
[src]

impl<S: Copy> Copy for Vector3<S>
[src]

impl<S: Clone> Clone for Vector3<S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S: Hash> Hash for Vector3<S>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<S: BaseFloat> MetricSpace for Vector3<S>
[src]

The metric to be returned by the distance function.

Returns the squared distance. Read more

The distance between two values.

impl<S: Copy> Array for Vector3<S>
[src]

Construct a vector from a single value, replicating it. Read more

The sum of the elements of the array.

The product of the elements of the array.

The minimum element of the array.

The maximum element of the array.

Get the pointer to the first element of the array.

Get a mutable pointer to the first element of the array.

Swap the elements at indices i and j in-place.

impl<S: BaseNum> Zero for Vector3<S>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<S: BaseNum> VectorSpace for Vector3<S>
[src]

The associated scalar.

impl<S: Neg<Output = S>> Neg for Vector3<S>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<S: BaseFloat> ApproxEq for Vector3<S>
[src]

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

The default relative tolerance for testing values that are far-apart. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

impl<S: BaseFloat + Rand> Rand for Vector3<S>
[src]

Generates a random instance of this type using the specified source of randomness. Read more

impl<S: BaseNum> Add<Vector3<S>> for Vector3<S>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, S: BaseNum> Add<&'a Vector3<S>> for Vector3<S>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, S: BaseNum> Add<Vector3<S>> for &'a Vector3<S>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b, S: BaseNum> Add<&'a Vector3<S>> for &'b Vector3<S>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<S: BaseNum + AddAssign<S>> AddAssign<Vector3<S>> for Vector3<S>
[src]

The method for the += operator

impl<S: BaseNum> Sub<Vector3<S>> for Vector3<S>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, S: BaseNum> Sub<&'a Vector3<S>> for Vector3<S>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, S: BaseNum> Sub<Vector3<S>> for &'a Vector3<S>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b, S: BaseNum> Sub<&'a Vector3<S>> for &'b Vector3<S>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<S: BaseNum + SubAssign<S>> SubAssign<Vector3<S>> for Vector3<S>
[src]

The method for the -= operator

impl<S: BaseNum> Mul<S> for Vector3<S>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, S: BaseNum> Mul<S> for &'a Vector3<S>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Vector3<S>
[src]

The method for the *= operator

impl<S: BaseNum> Div<S> for Vector3<S>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, S: BaseNum> Div<S> for &'a Vector3<S>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Vector3<S>
[src]

The method for the /= operator

impl<S: BaseNum> Rem<S> for Vector3<S>
[src]

The resulting type after applying the % operator

The method for the % operator

impl<'a, S: BaseNum> Rem<S> for &'a Vector3<S>
[src]

The resulting type after applying the % operator

The method for the % operator

impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Vector3<S>
[src]

The method for the %= operator

impl<S: BaseNum> ElementWise for Vector3<S>
[src]

impl<S: BaseNum> ElementWise<S> for Vector3<S>
[src]

impl<S> Index<usize> for Vector3<S>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<S> IndexMut<usize> for Vector3<S>
[src]

The method for the mutable indexing (container[index]) operation

impl<S> Index<Range<usize>> for Vector3<S>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<S> IndexMut<Range<usize>> for Vector3<S>
[src]

The method for the mutable indexing (container[index]) operation

impl<S> Index<RangeTo<usize>> for Vector3<S>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<S> IndexMut<RangeTo<usize>> for Vector3<S>
[src]

The method for the mutable indexing (container[index]) operation

impl<S> Index<RangeFrom<usize>> for Vector3<S>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<S> IndexMut<RangeFrom<usize>> for Vector3<S>
[src]

The method for the mutable indexing (container[index]) operation

impl<S> Index<RangeFull> for Vector3<S>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<S> IndexMut<RangeFull> for Vector3<S>
[src]

The method for the mutable indexing (container[index]) operation

impl<S> Into<[S; 3]> for Vector3<S>
[src]

Performs the conversion.

impl<S> AsRef<[S; 3]> for Vector3<S>
[src]

Performs the conversion.

impl<S> AsMut<[S; 3]> for Vector3<S>
[src]

Performs the conversion.

impl<S: Clone> From<[S; 3]> for Vector3<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a [S; 3]> for &'a Vector3<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a mut [S; 3]> for &'a mut Vector3<S>
[src]

Performs the conversion.

impl<S> Into<(S, S, S)> for Vector3<S>
[src]

Performs the conversion.

impl<S> AsRef<(S, S, S)> for Vector3<S>
[src]

Performs the conversion.

impl<S> AsMut<(S, S, S)> for Vector3<S>
[src]

Performs the conversion.

impl<S> From<(S, S, S)> for Vector3<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a (S, S, S)> for &'a Vector3<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a mut (S, S, S)> for &'a mut Vector3<S>
[src]

Performs the conversion.

impl<S: BaseFloat> InnerSpace for Vector3<S>
[src]

Vector dot (or inner) product.

Returns the angle between two vectors in radians.

Returns true if the vector is perpendicular (at right angles) to the other vector. Read more

Returns the squared magnitude. Read more

The distance from the tail to the tip of the vector.

Returns a vector with the same direction, but with a magnitude of 1.

Returns a vector with the same direction and a given magnitude.

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other by the specified amount. Read more

impl<S: Debug> Debug for Vector3<S>
[src]

Formats the value using the given formatter.