[−][src]Struct pathfinder_geometry::vector::Vector2F
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.
fn add(self, point: Vector2F) -> LineSegment2F
[src]
impl Add<Vector2F> for RectF
[src]
type Output = RectF
The resulting type after applying the +
operator.
fn add(self, other: Vector2F) -> RectF
[src]
impl Add<Vector2F> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the +
operator.
fn add(self, other: Vector2F) -> Vector2F
[src]
impl Add<f32> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the +
operator.
fn add(self, other: f32) -> Vector2F
[src]
impl AddAssign<Vector2F> for Vector2F
[src]
fn add_assign(&mut self, other: 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.
fn div(self, other: Vector2F) -> Vector2F
[src]
impl Div<f32> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the /
operator.
fn div(self, other: f32) -> Vector2F
[src]
impl IntoVector2F for Vector2F
[src]
fn into_vector_2f(self) -> Vector2F
[src]
impl Mul<Vector2F> for LineSegment2F
[src]
type Output = LineSegment2F
The resulting type after applying the *
operator.
fn mul(self, factors: Vector2F) -> LineSegment2F
[src]
impl Mul<Vector2F> for RectF
[src]
type Output = RectF
The resulting type after applying the *
operator.
fn mul(self, factors: Vector2F) -> RectF
[src]
impl Mul<Vector2F> for Matrix2x2F
[src]
type Output = Vector2F
The resulting type after applying the *
operator.
fn mul(self, vector: Vector2F) -> Vector2F
[src]
impl Mul<Vector2F> for Transform2F
[src]
type Output = Vector2F
The resulting type after applying the *
operator.
fn mul(self, vector: Vector2F) -> Vector2F
[src]
impl Mul<Vector2F> for Perspective
[src]
type Output = Vector2F
The resulting type after applying the *
operator.
fn mul(self, vector: Vector2F) -> Vector2F
[src]
impl Mul<Vector2F> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the *
operator.
fn mul(self, other: Vector2F) -> Vector2F
[src]
impl Mul<f32> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the *
operator.
fn mul(self, other: f32) -> Vector2F
[src]
impl MulAssign<Vector2F> for LineSegment2F
[src]
fn mul_assign(&mut self, factors: Vector2F)
[src]
impl MulAssign<Vector2F> for Vector2F
[src]
fn mul_assign(&mut self, other: Vector2F)
[src]
impl MulAssign<f32> for Vector2F
[src]
fn mul_assign(&mut self, other: f32)
[src]
impl Neg for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the -
operator.
fn neg(self) -> Vector2F
[src]
impl PartialEq<Vector2F> for Vector2F
[src]
impl Sub<Vector2F> for LineSegment2F
[src]
type Output = LineSegment2F
The resulting type after applying the -
operator.
fn sub(self, point: Vector2F) -> LineSegment2F
[src]
impl Sub<Vector2F> for RectF
[src]
type Output = RectF
The resulting type after applying the -
operator.
fn sub(self, other: Vector2F) -> RectF
[src]
impl Sub<Vector2F> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the -
operator.
fn sub(self, other: Vector2F) -> Vector2F
[src]
impl Sub<f32> for Vector2F
[src]
type Output = Vector2F
The resulting type after applying the -
operator.
fn sub(self, other: f32) -> Vector2F
[src]
impl SubAssign<Vector2F> for Vector2F
[src]
fn sub_assign(&mut self, other: Vector2F)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector2F
impl Send for Vector2F
impl Sync for Vector2F
impl Unpin for Vector2F
impl UnwindSafe for Vector2F
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,