Skip to main content

Arc

Struct Arc 

Source
pub struct Arc<T: Float + FloatConst> { /* private fields */ }
Expand description

An Arc of a Great Circle on a unit sphere.

Implementations§

Source§

impl<T> Arc<T>
where T: Float + FloatConst + Scalar + ComplexField<RealField = T>, f64: From<T>,

Source

pub const fn new( a: Vector3<T>, pole: Vector3<T>, length: Radians<T>, half_width: Radians<T>, ) -> Self

Construct an Arc

  • a - the start point of the Arc.
  • pole - the right hand pole of the Great Circle of the Arc.
  • length - the length of the Arc.
  • half_width - the half width of the Arc.
Source

pub fn from_lat_lon_azi_length( a: &LatLong<T>, azimuth: Angle<T>, length: Radians<T>, ) -> Self

Construct an Arc

  • a - the start position
  • azimuth - the azimuth at a.
  • length - the length of the Arc.
Source

pub fn between_positions(a: &LatLong<T>, b: &LatLong<T>) -> Self

Construct an Arc from the start and end positions.

Note: if the points are the same or antipodal, the pole will be invalid.

  • a, b - the start and end positions
Source

pub const fn set_half_width(&mut self, half_width: Radians<T>) -> &mut Self

Set the half_width of an Arc.

  • half_width - the half width of the Arc.
Source

pub const fn a(&self) -> Vector3<T>

The start point of the Arc.

Source

pub const fn pole(&self) -> Vector3<T>

The right hand pole of the Great Circle at the start point of the Arc.

Source

pub const fn length(&self) -> Radians<T>

The length of the Arc.

Source

pub const fn half_width(&self) -> Radians<T>

The half width of the Arc.

Source

pub fn azimuth(&self) -> Angle<T>

The azimuth at the start point.

Source

pub fn direction(&self) -> Vector3<T>

The direction vector of the Arc at the start point.

Source

pub fn position(&self, distance: Radians<T>) -> Vector3<T>

A position vector at distance along the Arc.

Source

pub fn b(&self) -> Vector3<T>

The end point of the Arc.

Source

pub fn mid_point(&self) -> Vector3<T>

The mid point of the Arc.

Source

pub fn perp_position( &self, point: &Vector3<T>, distance: Radians<T>, ) -> Vector3<T>

The position of a perpendicular point at distance from the Arc.

  • point a point on the Arc’s great circle.
  • distance the perpendicular distance from the Arc’s great circle.

returns the point at perpendicular distance from point.

Source

pub fn angle_position(&self, angle: Angle<T>) -> Vector3<T>

The position of a point at angle from the Arc start, at Arc length.

  • angle the angle from the Arc start.

returns the point at angle from the Arc start, at Arc length.

Source

pub fn end_arc(&self, at_b: bool) -> Self

The Arc at the end of an Arc, just the point if half_width is zero.

@param at_b if true the Arc at b, else the Arc at a.

@return the end Arc at a or b.

Source

pub fn calculate_atd_and_xtd( &self, point: &Vector3<T>, ) -> (Radians<T>, Radians<T>)

Calculate great-circle along and across track distances of point from the Arc.

  • point - the point.

returns the along and across track distances of the point in Radians.

Source

pub fn shortest_distance(&self, point: &Vector3<T>) -> Radians<T>

Calculate the shortest great-circle distance of a point from the Arc.

  • point - the point.

returns the shortest distance of a point from the Arc in Radians.

Trait Implementations§

Source§

impl<T: Clone + Float + FloatConst> Clone for Arc<T>

Source§

fn clone(&self) -> Arc<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + Float + FloatConst> Copy for Arc<T>

Source§

impl<T: Debug + Float + FloatConst> Debug for Arc<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Eq + Float + FloatConst> Eq for Arc<T>

Source§

impl<T: PartialEq + Float + FloatConst> PartialEq for Arc<T>

Source§

fn eq(&self, other: &Arc<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq + Float + FloatConst> StructuralPartialEq for Arc<T>

Source§

impl<T> TryFrom<(&LatLong<T>, &LatLong<T>)> for Arc<T>
where T: Float + FloatConst + Scalar + ComplexField<RealField = T>, f64: From<T>,

Source§

fn try_from(params: (&LatLong<T>, &LatLong<T>)) -> Result<Self, Self::Error>

Construct an Arc from a pair of positions.

  • params - the start and end positions
Source§

type Error = ArcError<T>

The type returned in the event of a conversion error.
Source§

impl<T> Validate for Arc<T>
where T: Float + FloatConst + Scalar + ComplexField<RealField = T>,

Source§

fn is_valid(&self) -> bool

Test whether an Arc is valid.

I.e. both a and pole are on the unit sphere and are orthogonal and both length and half_width are not negative.

Auto Trait Implementations§

§

impl<T> Freeze for Arc<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Arc<T>
where T: RefUnwindSafe,

§

impl<T> Send for Arc<T>
where T: Send,

§

impl<T> Sync for Arc<T>
where T: Sync,

§

impl<T> Unpin for Arc<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Arc<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Arc<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.