Struct victor::svg::elliptical_arc::ByCenter [] [src]

pub struct ByCenter {
    pub center: Pair,
    pub radius: Pair,
    pub x_axis_rotation: Angle,
    pub start_angle: Angle,
    pub sweep_angle: Angle,
}

Provides the center parameterization of an elliptical arc.

https://www.w3.org/TR/SVG/implnote.html#ArcParameterizationAlternatives

Points (x, y) on the arc are:

( x )   ( cos(φ)  -sin(φ) )   ( radius.x * cos(θ) )   ( center.x )
( y ) = ( sin(φ)   cos(φ) ) * ( radius.y * sin(θ) ) + ( center.y )

where θ goes from start_angle to start_angle + sweep_angle. φ is x_axis_rotation.

start_angle and sweep_angle are theoretical angles, not measures of the actual arc.

An ellipse can be thought of as a circle that has been stretched along the X or Y axis by the ratio of radius.x / radius.y, then rotated by x_axis_rotation. θ1 and Δθ and θ + Δθ are angles in that circle before stretching and rotating.

The arc is clockwise if sweep_angle is positive, counter-clockwise if it is negative.

Fields

Non-negative

Trait Implementations

impl Copy for ByCenter
[src]

impl Clone for ByCenter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ByCenter
[src]

Formats the value using the given formatter.