# Struct siege_math::vector::Vec3 [−] [src]

```#[repr(C)]
pub struct Vec3<F> {
pub x: F,
pub y: F,
pub z: F,
}```

A 3-element vector

## Methods

### `impl<F: FullFloat> Vec3<F>`[src]

#### `pub fn new(x: F, y: F, z: F) -> Vec3<F>`[src]

Construct a new vector

## Trait Implementations

### `impl<F: FullFloat> From<Point3<F>> for Vec3<F>`[src]

#### `fn from(v: Point3<F>) -> Vec3<F>`[src]

Performs the conversion.

### `impl<F: FullFloat> From<Vec3<F>> for Point3<F>`[src]

#### `fn from(v: Vec3<F>) -> Point3<F>`[src]

Performs the conversion.

### `impl<F: FullFloat> Add<Vec3<F>> for Point3<F>`[src]

#### `type Output = Point3<F>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: Vec3<F>) -> Point3<F>`[src]

Performs the `+` operation.

### `impl<F: FullFloat> Sub<Vec3<F>> for Point3<F>`[src]

#### `type Output = Point3<F>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: Vec3<F>) -> Point3<F>`[src]

Performs the `-` operation.

### `impl<F: FullFloat> From<Direction3<F>> for Vec3<F>`[src]

#### `fn from(v: Direction3<F>) -> Vec3<F>`[src]

Performs the conversion.

### `impl<F: FullFloat> From<Vec3<F>> for Direction3<F>`[src]

#### `fn from(v: Vec3<F>) -> Direction3<F>`[src]

Performs the conversion.

### `impl<F: Debug> Debug for Vec3<F>`[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<F: Clone> Clone for Vec3<F>`[src]

#### `fn clone(&self) -> Vec3<F>`[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from `source`. Read more

### `impl<F: PartialEq> PartialEq for Vec3<F>`[src]

#### `fn eq(&self, __arg_0: &Vec3<F>) -> bool`[src]

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

#### `fn ne(&self, __arg_0: &Vec3<F>) -> bool`[src]

This method tests for `!=`.

### `impl<F: Hash> Hash for Vec3<F>`[src]

#### `fn hash<__HF: Hasher>(&self, __arg_0: &mut __HF)`[src]

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

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where    H: Hasher, `1.3.0[src]

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

### `impl<F: FullFloat> Index<usize> for Vec3<F>`[src]

#### `type Output = F`

The returned type after indexing.

#### `fn index(&self, i: usize) -> &F`[src]

Performs the indexing (`container[index]`) operation.

### `impl<F: FullFloat> IndexMut<usize> for Vec3<F>`[src]

#### `fn index_mut(&mut self, i: usize) -> &mut F`[src]

Performs the mutable indexing (`container[index]`) operation.

### `impl<F: FullFloat> Default for Vec3<F>`[src]

#### `fn default() -> Vec3<F>`[src]

Returns the "default value" for a type. Read more

### `impl<F: FullFloat> Mul<F> for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: F) -> Vec3<F>`[src]

Performs the `*` operation.

### `impl<F: FullFloat> Mul<Vec3<F>> for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Vec3<F>) -> Vec3<F>`[src]

Performs the `*` operation.

### `impl<F: FullFloat> MulAssign<F> for Vec3<F>`[src]

#### `fn mul_assign(&mut self, rhs: F)`[src]

Performs the `*=` operation.

### `impl<F: FullFloat> Div<F> for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `/` operator.

#### `fn div(self, rhs: F) -> Vec3<F>`[src]

Performs the `/` operation.

### `impl<F: FullFloat> DivAssign<F> for Vec3<F>`[src]

#### `fn div_assign(&mut self, rhs: F)`[src]

Performs the `/=` operation.

### `impl<F: FullFloat> Neg for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `-` operator.

#### `fn neg(self) -> Vec3<F>`[src]

Performs the unary `-` operation.

### `impl<F: FullFloat> Add for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: Vec3<F>) -> Vec3<F>`[src]

Performs the `+` operation.

### `impl<F: FullFloat> AddAssign<Vec3<F>> for Vec3<F>`[src]

#### `fn add_assign(&mut self, other: Vec3<F>)`[src]

Performs the `+=` operation.

### `impl<F: FullFloat> Sub for Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: Vec3<F>) -> Vec3<F>`[src]

Performs the `-` operation.

### `impl<F: FullFloat> SubAssign<Vec3<F>> for Vec3<F>`[src]

#### `fn sub_assign(&mut self, other: Vec3<F>)`[src]

Performs the `-=` operation.

### `impl<F: FullFloat> From<Vec4<F>> for Vec3<F>`[src]

#### `fn from(v: Vec4<F>) -> Vec3<F>`[src]

Performs the conversion.

### `impl<F: FullFloat> From<Vec3<F>> for Vec2<F>`[src]

#### `fn from(v: Vec3<F>) -> Vec2<F>`[src]

Performs the conversion.

### `impl From<Vec3<f64>> for Vec3<f32>`[src]

#### `fn from(v: Vec3<f64>) -> Vec3<f32>`[src]

Performs the conversion.

### `impl From<Vec3<f32>> for Vec3<f64>`[src]

#### `fn from(v: Vec3<f32>) -> Vec3<f64>`[src]

Performs the conversion.

### `impl<F: FullFloat> ApproxEq for Vec3<F>`[src]

#### `fn approx_eq(    &self,     other: &Self,     epsilon: <F as ApproxEq>::Flt,     ulps: <<F as ApproxEq>::Flt as Ulps>::U) -> bool`[src]

This method tests for `self` and `other` values to be approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more

#### `fn approx_ne(    &self,     other: &Self,     epsilon: Self::Flt,     ulps: <Self::Flt as Ulps>::U) -> bool`[src]

This method tests for `self` and `other` values to be not approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more

### `impl<'a, 'b, F: FullFloat> Mul<&'a Vec3<F>> for &'b Mat3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: &Vec3<F>) -> Vec3<F>`[src]

Performs the `*` operation.

### `impl<'a, 'b, F: FullFloat> Mul<&'a Mat3<F>> for &'a Vec3<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: &Mat3<F>) -> Vec3<F>`[src]

Performs the `*` operation.

### `impl<F: FullFloat> Mul<Vec3<F>> for NQuat<F>`[src]

#### `type Output = Vec3<F>`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Vec3<F>) -> Vec3<F>`[src]

Performs the `*` operation.