# [−][src]Struct tray_rust::linalg::point::Point

Point is a standard 3 component point but transforms as a point point when transformations are applied

## Fields

`x: f32`

`y: f32`

`z: f32`

## Methods

`impl Point`

[src]

`pub fn new(x: f32, y: f32, z: f32) -> Point`

[src]

Initialize the point and set values for x, y, z

`pub fn broadcast(x: f32) -> Point`

[src]

Initialize the point with the same value of x, y, z

`pub fn origin() -> Point`

[src]

Initialize a point to be all 0 values

`pub fn distance_sqr(&self, a: &Point) -> f32`

[src]

Compute the squared distance between this point and another

`pub fn distance(&self, a: &Point) -> f32`

[src]

Compute the distance between this point and another

## Trait Implementations

`impl Clone for Point`

[src]

`impl Copy for Point`

[src]

`impl PartialEq<Point> for Point`

[src]

`impl Debug for Point`

[src]

`impl Div<Point> for Point`

[src]

`type Output = Point`

The resulting type after applying the `/`

operator.

`fn div(self, rhs: Point) -> Point`

[src]

Divide the points components by the right hand side's components

`impl Div<f32> for Point`

[src]

`type Output = Point`

The resulting type after applying the `/`

operator.

`fn div(self, rhs: f32) -> Point`

[src]

Divide the points components by scalar

`impl Sub<Point> for Point`

[src]

`type Output = Vector`

The resulting type after applying the `-`

operator.

`fn sub(self, rhs: Point) -> Vector`

[src]

Subtract two points to get the vector between them

`impl Sub<Vector> for Point`

[src]

`type Output = Point`

The resulting type after applying the `-`

operator.

`fn sub(self, rhs: Vector) -> Point`

[src]

Subtract a vector from a point, translating the point by -vector

`impl Add<Point> for Point`

[src]

`type Output = Point`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: Point) -> Point`

[src]

Add two points together

`impl Add<Vector> for Point`

[src]

`type Output = Point`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: Vector) -> Point`

[src]

Add two points together

`impl Mul<Point> for Vector`

[src]

`type Output = Point`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: Point) -> Point`

[src]

Scale the vector by some value

`impl Mul<f32> for Point`

[src]

`type Output = Point`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: f32) -> Point`

[src]

Scale the point by some value

`impl Mul<Point> for f32`

[src]

`type Output = Point`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: Point) -> Point`

[src]

Scale the vector by some value

`impl Mul<Vector> for Point`

[src]

`type Output = Point`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: Vector) -> Point`

[src]

Scale the vector by some value

`impl Mul<Point> for Transform`

[src]

`type Output = Point`

The resulting type after applying the `*`

operator.

`fn mul(self, p: Point) -> Point`

[src]

Multiply the point by the transform to apply the transformation

`impl Neg for Point`

[src]

`type Output = Point`

The resulting type after applying the `-`

operator.

`fn neg(self) -> Point`

[src]

Negate the point

`impl Index<usize> for Point`

[src]

`type Output = f32`

The returned type after indexing.

`fn index(&self, i: usize) -> &f32`

[src]

Access the point by index

- 0 = x
- 1 = y
- 2 = z

`impl Index<Axis> for Point`

[src]

`type Output = f32`

The returned type after indexing.

`fn index(&self, i: Axis) -> &f32`

[src]

Access the point by index

- 0 = x
- 1 = y
- 2 = z

`impl IndexMut<usize> for Point`

[src]

`impl StructuralPartialEq for Point`

[src]

## Auto Trait Implementations

`impl Send for Point`

`impl Sync for Point`

`impl Unpin for Point`

`impl UnwindSafe for Point`

`impl RefUnwindSafe for Point`

## Blanket Implementations

`impl<T, U> Into<U> for T where`

U: From<T>,

[src]

U: From<T>,

`impl<T> From<T> for T`

[src]

`impl<T> ToOwned for T where`

T: Clone,

[src]

T: Clone,

`type Owned = T`

The resulting type after obtaining ownership.

`fn to_owned(&self) -> T`

[src]

`fn clone_into(&self, target: &mut T)`

[src]

`impl<T, U> TryFrom<U> for T where`

U: Into<T>,

[src]

U: Into<T>,

`type Error = Infallible`

The type returned in the event of a conversion error.

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

`impl<T, U> TryInto<U> for T where`

U: TryFrom<T>,

[src]

U: TryFrom<T>,

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

The type returned in the event of a conversion error.

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

`impl<T> Borrow<T> for T where`

T: ?Sized,

[src]

T: ?Sized,

`impl<T> BorrowMut<T> for T where`

T: ?Sized,

[src]

T: ?Sized,

`fn borrow_mut(&mut self) -> &mut T`

[src]

`impl<T> Any for T where`

T: 'static + ?Sized,

[src]

T: 'static + ?Sized,

`impl<T> Interpolate for T where`

T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,

[src]

T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,