[][src]Struct pathfinder_geometry::vector::Vector2F

pub struct Vector2F(pub F32x2);

2D points with 32-bit floating point coordinates.

Methods

impl Vector2F[src]

pub fn new(x: f32, y: f32) -> Vector2F[src]

pub fn splat(value: f32) -> Vector2F[src]

pub fn zero() -> Vector2F[src]

pub fn to_3d(self) -> Vector3F[src]

pub fn to_4d(self) -> Vector4F[src]

pub fn x(self) -> f32[src]

pub fn y(self) -> f32[src]

pub fn set_x(&mut self, x: f32)[src]

pub fn set_y(&mut self, y: f32)[src]

pub fn min(self, other: Vector2F) -> Vector2F[src]

pub fn max(self, other: Vector2F) -> Vector2F[src]

pub fn clamp(self, min_val: Vector2F, max_val: Vector2F) -> Vector2F[src]

pub fn det(self, other: Vector2F) -> f32[src]

pub fn dot(self, other: Vector2F) -> f32[src]

pub fn floor(self) -> Vector2F[src]

pub fn ceil(self) -> Vector2F[src]

pub fn round(self) -> Vector2F[src]

Rounds both coordinates to the nearest integer.

pub fn square_length(self) -> f32[src]

Treats this point as a vector and calculates its squared length.

pub fn length(self) -> f32[src]

Treats this point as a vector and calculates its length.

pub fn normalize(self) -> Vector2F[src]

Treats this point as a vector and normalizes it.

pub fn yx(self) -> Vector2F[src]

Swaps y and x.

pub fn projection_coefficient(self, a: Vector2F) -> f32[src]

Returns the coefficient when the given vector a is projected onto this one.

That is, if this vector is v and this function returns c, then proj_v a = cv. In other words, this function computes (a⋅v) / (v⋅v).

pub fn is_zero(self) -> bool[src]

pub fn lerp(self, other: Vector2F, t: f32) -> Vector2F[src]

pub fn to_i32(self) -> Vector2I[src]

Trait Implementations

impl Add<Vector2F> for LineSegment2F[src]

type Output = LineSegment2F

The resulting type after applying the + operator.

impl Add<Vector2F> for RectF[src]

type Output = RectF

The resulting type after applying the + operator.

impl Add<Vector2F> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the + operator.

impl Add<f32> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the + operator.

impl AddAssign<Vector2F> for Vector2F[src]

impl Clone for Vector2F[src]

impl Copy for Vector2F[src]

impl Debug for Vector2F[src]

impl Default for Vector2F[src]

impl Div<Vector2F> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the / operator.

impl Div<f32> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the / operator.

impl IntoVector2F for Vector2F[src]

impl Mul<Vector2F> for LineSegment2F[src]

type Output = LineSegment2F

The resulting type after applying the * operator.

impl Mul<Vector2F> for RectF[src]

type Output = RectF

The resulting type after applying the * operator.

impl Mul<Vector2F> for Matrix2x2F[src]

type Output = Vector2F

The resulting type after applying the * operator.

impl Mul<Vector2F> for Transform2F[src]

type Output = Vector2F

The resulting type after applying the * operator.

impl Mul<Vector2F> for Perspective[src]

type Output = Vector2F

The resulting type after applying the * operator.

impl Mul<Vector2F> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the * operator.

impl Mul<f32> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the * operator.

impl MulAssign<Vector2F> for LineSegment2F[src]

impl MulAssign<Vector2F> for Vector2F[src]

impl MulAssign<f32> for Vector2F[src]

impl Neg for Vector2F[src]

type Output = Vector2F

The resulting type after applying the - operator.

impl PartialEq<Vector2F> for Vector2F[src]

impl Sub<Vector2F> for LineSegment2F[src]

type Output = LineSegment2F

The resulting type after applying the - operator.

impl Sub<Vector2F> for RectF[src]

type Output = RectF

The resulting type after applying the - operator.

impl Sub<Vector2F> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the - operator.

impl Sub<f32> for Vector2F[src]

type Output = Vector2F

The resulting type after applying the - operator.

impl SubAssign<Vector2F> for Vector2F[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.