#[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) -> Self
pub fn normalize(&self) -> Self
Returns a unit-length vector in the same direction, or zero if the length is zero.
Sourcepub fn rotate_90deg_ccw(&self) -> Self
pub fn rotate_90deg_ccw(&self) -> Self
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