# [−][src]Struct footile::Pt

`pub struct Pt(pub f32, pub f32);`

2-dimensional vector / point.

## Implementations

### `impl Pt`[src]

Get the X value

Get the Y value

#### `pub fn mag(self) -> f32`[src]

Get the magnitude of a vector

#### `pub fn normalize(self) -> Self`[src]

Create a copy normalized to unit length

#### `pub fn dist_sq(self, rhs: Self) -> f32`[src]

Calculate the distance squared between two points

#### `pub fn dist(self, rhs: Self) -> f32`[src]

Calculate the distance between two points

#### `pub fn midpoint(self, rhs: Self) -> Self`[src]

Get the midpoint of two points

#### `pub fn left(self) -> Self`[src]

Create a left-hand perpendicular vector

#### `pub fn right(self) -> Self`[src]

Create a right-hand perpendicular vector

#### `pub fn lerp(self, rhs: Self, t: f32) -> Self`[src]

Calculate linear interpolation of two points.

• `t` Interpolation amount, from 0 to 1

#### `pub fn angle_rel(self, rhs: Self) -> f32`[src]

Calculate the relative angle to another vector / point.

The result will be between `-PI` and `+PI`.

## Trait Implementations

### `impl Add<Pt> for Pt`[src]

#### `type Output = Self`

The resulting type after applying the `+` operator.

### `impl Div<f32> for Pt`[src]

#### `type Output = Self`

The resulting type after applying the `/` operator.

### `impl Mul<Pt> for Pt`[src]

#### `type Output = f32`

The resulting type after applying the `*` operator.

#### `fn mul(self, rhs: Self) -> f32`[src]

Calculate the cross product of two vectors

### `impl Mul<Pt> for Transform`[src]

#### `type Output = Pt`

The resulting type after applying the `*` operator.

### `impl Mul<f32> for Pt`[src]

#### `type Output = Self`

The resulting type after applying the `*` operator.

### `impl Neg for Pt`[src]

#### `type Output = Self`

The resulting type after applying the `-` operator.

### `impl Sub<Pt> for Pt`[src]

#### `type Output = Self`

The resulting type after applying the `-` operator.

## Blanket Implementations

### `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.