#[repr(C)]pub struct SvgVector {
pub x: f64,
pub y: f64,
}Expand description
A 2D vector with f64 coordinates, used for tangent and direction calculations.
Fields§
§x: f64§y: f64Implementations§
Source§impl SvgVector
impl SvgVector
Sourcepub fn angle_degrees(&self) -> f64
pub fn angle_degrees(&self) -> f64
Returns the angle of the vector in degrees
Sourcepub fn normalize(&self) -> SvgVector
pub fn normalize(&self) -> SvgVector
Returns a unit-length vector in the same direction, or zero if the length is zero.
Sourcepub fn rotate_90deg_ccw(&self) -> SvgVector
pub fn rotate_90deg_ccw(&self) -> SvgVector
Rotate the vector 90 degrees counter-clockwise
Trait Implementations§
Source§impl PartialOrd for SvgVector
impl PartialOrd for SvgVector
impl Copy for SvgVector
impl StructuralPartialEq for SvgVector
Auto Trait Implementations§
impl Freeze for SvgVector
impl RefUnwindSafe for SvgVector
impl Send for SvgVector
impl Sync for SvgVector
impl Unpin for SvgVector
impl UnsafeUnpin for SvgVector
impl UnwindSafe for SvgVector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more