pub struct Arc {
pub center: [f64; 3],
pub radius: f64,
pub start_angle: f64,
pub end_angle: f64,
pub u_axis: [f64; 3],
pub v_axis: [f64; 3],
}Expand description
A parametric circular arc in 3-D space.
The arc lies in a plane defined by two orthogonal unit vectors u_axis and
v_axis. The arc sweeps from start_angle to end_angle (in radians)
around center at the given radius.
Fields§
§center: [f64; 3]Centre point of the arc.
radius: f64Radius of the arc.
start_angle: f64Start angle in radians.
end_angle: f64End angle in radians.
u_axis: [f64; 3]First axis of the arc plane (should be a unit vector).
v_axis: [f64; 3]Second axis of the arc plane (should be a unit vector perpendicular to u_axis).
Implementations§
Source§impl Arc
impl Arc
Sourcepub fn in_xy_plane(
center: [f64; 3],
radius: f64,
start_angle: f64,
end_angle: f64,
) -> Self
pub fn in_xy_plane( center: [f64; 3], radius: f64, start_angle: f64, end_angle: f64, ) -> Self
Construct an arc in the XY plane.
Sourcepub fn evaluate(&self, t: f64) -> [f64; 3]
pub fn evaluate(&self, t: f64) -> [f64; 3]
Evaluate the arc at parameter t ∈ [0, 1].
t = 0 gives start_angle, t = 1 gives end_angle.
Sourcepub fn arc_length(&self) -> f64
pub fn arc_length(&self) -> f64
Arc length (exact: radius × |end_angle − start_angle|).
Auto Trait Implementations§
impl Freeze for Arc
impl RefUnwindSafe for Arc
impl Send for Arc
impl Sync for Arc
impl Unpin for Arc
impl UnsafeUnpin for Arc
impl UnwindSafe for Arc
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.