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
center: Pair
radius: Pair
Non-negative
x_axis_rotation: Angle
start_angle: Angle
sweep_angle: Angle
Trait Implementations
impl Copy for ByCenter
[src]
impl Clone for ByCenter
[src]
fn clone(&self) -> ByCenter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more