[−][src]Struct arcs::primitives::Arc
A circle segment.
Implementations
impl<S> Arc<S>
[src]
pub fn from_centre_radius(
centre: Point2D<f64, S>,
radius: f64,
start_angle: Angle<f64>,
sweep_angle: Angle<f64>
) -> Arc<S>
[src]
centre: Point2D<f64, S>,
radius: f64,
start_angle: Angle<f64>,
sweep_angle: Angle<f64>
) -> Arc<S>
pub fn from_three_points(
start: Point2D<f64, S>,
middle: Point2D<f64, S>,
end: Point2D<f64, S>
) -> Option<Arc<S>>
[src]
start: Point2D<f64, S>,
middle: Point2D<f64, S>,
end: Point2D<f64, S>
) -> Option<Arc<S>>
Try to find the Arc
which will pass through three points.
Examples
You can use this constructor in the normal way.
use arcs_core::primitives::Arc; let right = Point::new(10.0, 0.0); let above = Point::new(0.0, 10.0); let left = Point::new(-10.0, 0.0); let got = Arc::from_three_points(right, above, left).unwrap(); assert_eq!(got.centre(), Point::zero()); assert_eq!(got.radius(), 10.0); assert!(got.is_anticlockwise());
This will fail if the three points are Orientation::Collinear
.
use arcs_core::primitives::Arc; let start = Point::new(0.0, 0.0); let middle = Point::new(10.0, 0.0); let end = Point::new(20.0, 0.0); let got = Arc::from_three_points(start, middle, end); assert!(got.is_none());
pub const fn centre(self) -> Point2D<f64, S>
[src]
The Arc
's centre point.
pub const fn radius(self) -> f64
[src]
The Arc
's radius.
pub const fn start_angle(self) -> Angle<f64>
[src]
pub const fn sweep_angle(self) -> Angle<f64>
[src]
pub fn end_angle(self) -> Angle<f64>
[src]
pub fn is_anticlockwise(self) -> bool
[src]
pub fn is_clockwise(self) -> bool
[src]
pub fn start(self) -> Point2D<f64, S>
[src]
pub fn end(self) -> Point2D<f64, S>
[src]
pub fn point_at(self, angle: Angle<f64>) -> Point2D<f64, S>
[src]
pub fn contains_angle(self, angle: Angle<f64>) -> bool
[src]
pub fn is_minor_arc(&self) -> bool
[src]
pub fn is_major_arc(&self) -> bool
[src]
Trait Implementations
impl<Space> Approximate<Space> for Arc<Space>
[src]
type Iter = ApproximatedArc<Space>
An iterator over the approximated vertices.
fn approximate(
&self,
tolerance: f64
) -> <Arc<Space> as Approximate<Space>>::Iter
[src]
&self,
tolerance: f64
) -> <Arc<Space> as Approximate<Space>>::Iter
impl<S> Bounded<S> for Arc<S>
[src]
fn bounding_box(&self) -> BoundingBox<S>
[src]
impl<S> Clone for Arc<S>
[src]
impl<Space> ClosestPoint<Space> for Arc<Space>
[src]
fn closest_point(&self, target: Point2D<f64, Space>) -> Closest<Space>
[src]
impl<S> Copy for Arc<S>
[src]
impl<S> Debug for Arc<S> where
S: Debug,
[src]
S: Debug,
impl<Space> Length for Arc<Space>
[src]
fn length(&self) -> f64
[src]
Calculates the length of an Arc
.
let radius = 50.0; let arc = Arc::from_centre_radius( Point::zero(), radius, Angle::zero(), Angle::two_pi(), ); assert_eq!(arc.length(), 2.0 * radius * PI);
impl<S> PartialEq<Arc<S>> for Arc<S> where
S: PartialEq<S>,
[src]
S: PartialEq<S>,
impl<Space> Scale for Arc<Space>
[src]
fn scale(&mut self, scale_factor: f64)
[src]
fn scaled(&self, scale_factor: f64) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<S> StructuralPartialEq for Arc<S>
[src]
impl<Space> Translate<Space> for Arc<Space>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Arc<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Arc<S> where
S: Send,
S: Send,
impl<S> Sync for Arc<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Arc<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Arc<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> RoundFrom<T> for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,
fn round_into(self) -> U
[src]
impl<S> Scale for S where
S: ScaleNonUniform,
[src]
S: ScaleNonUniform,
fn scale(&mut self, scale_factor: f64)
[src]
fn scaled(&self, scale_factor: f64) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<Space, A> Translate<Space> for A where
A: AffineTransformable,
[src]
A: AffineTransformable,
fn translate(&mut self, displacement: Vector2D<f64, Space>)
[src]
fn translated(&self, displacement: Vector2D<f64, Space>) -> Self where
Self: Clone,
[src]
Self: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,