#[repr(C)]pub struct SvgQuadraticCurve {
pub start: SvgPoint,
pub ctrl: SvgPoint,
pub end: SvgPoint,
}Expand description
A quadratic bezier curve defined by start, one control point, and end point.
Fields§
§start: SvgPoint§ctrl: SvgPoint§end: SvgPointImplementations§
Source§impl SvgQuadraticCurve
impl SvgQuadraticCurve
Sourcepub const fn new(start: SvgPoint, ctrl: SvgPoint, end: SvgPoint) -> Self
pub const fn new(start: SvgPoint, ctrl: SvgPoint, end: SvgPoint) -> Self
Creates a new SvgQuadraticCurve from start, control, and end points
Sourcepub fn get_bounds(&self) -> SvgRect
pub fn get_bounds(&self) -> SvgRect
Returns the axis-aligned bounding box of the curve’s control points.
Sourcepub fn get_x_at_t(&self, t: f64) -> f64
pub fn get_x_at_t(&self, t: f64) -> f64
Evaluates the x coordinate of the curve at parameter t in [0, 1].
Sourcepub fn get_y_at_t(&self, t: f64) -> f64
pub fn get_y_at_t(&self, t: f64) -> f64
Evaluates the y coordinate of the curve at parameter t in [0, 1].
Sourcepub fn get_length(&self) -> f64
pub fn get_length(&self) -> f64
Returns the approximate arc length by converting to a cubic curve.
Sourcepub fn get_t_at_offset(&self, offset: f64) -> f64
pub fn get_t_at_offset(&self, offset: f64) -> f64
Returns the parameter t corresponding to a given arc-length offset.
Sourcepub fn get_tangent_vector_at_t(&self, t: f64) -> SvgVector
pub fn get_tangent_vector_at_t(&self, t: f64) -> SvgVector
Returns the normalized tangent vector at parameter t.
Trait Implementations§
Source§impl Clone for SvgQuadraticCurve
impl Clone for SvgQuadraticCurve
Source§fn clone(&self) -> SvgQuadraticCurve
fn clone(&self) -> SvgQuadraticCurve
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SvgQuadraticCurve
impl Debug for SvgQuadraticCurve
Source§impl PartialEq for SvgQuadraticCurve
impl PartialEq for SvgQuadraticCurve
Source§fn eq(&self, other: &SvgQuadraticCurve) -> bool
fn eq(&self, other: &SvgQuadraticCurve) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SvgQuadraticCurve
impl PartialOrd for SvgQuadraticCurve
impl Copy for SvgQuadraticCurve
impl StructuralPartialEq for SvgQuadraticCurve
Auto Trait Implementations§
impl Freeze for SvgQuadraticCurve
impl RefUnwindSafe for SvgQuadraticCurve
impl Send for SvgQuadraticCurve
impl Sync for SvgQuadraticCurve
impl Unpin for SvgQuadraticCurve
impl UnsafeUnpin for SvgQuadraticCurve
impl UnwindSafe for SvgQuadraticCurve
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