Arc

Struct Arc 

Source
pub struct Arc { /* private fields */ }
Expand description

An Arc of a Great Circle on a unit sphere.

Implementations§

Source§

impl Arc

Source

pub const fn new( a: Vector3d, pole: Vector3d, length: Radians, half_width: Radians, ) -> 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, azimuth: Angle, length: Radians, ) -> 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, b: &LatLong) -> 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) -> &mut Self

Set the half_width of an Arc.

  • half_width - the half width of the Arc.
Source

pub const fn a(&self) -> Vector3d

The start point of the Arc.

Source

pub const fn pole(&self) -> Vector3d

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

Source

pub const fn length(&self) -> Radians

The length of the Arc.

Source

pub const fn half_width(&self) -> Radians

The half width of the Arc.

Source

pub fn azimuth(&self) -> Angle

The azimuth at the start point.

Source

pub fn direction(&self) -> Vector3d

The direction vector of the Arc at the start point.

Source

pub fn position(&self, distance: Radians) -> Vector3d

A position vector at distance along the Arc.

Source

pub fn b(&self) -> Vector3d

The end point of the Arc.

Source

pub fn mid_point(&self) -> Vector3d

The mid point of the Arc.

Source

pub fn perp_position(&self, point: &Vector3d, distance: Radians) -> Vector3d

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) -> Vector3d

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: &Vector3d) -> (Radians, Radians)

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: &Vector3d) -> Radians

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 Clone for Arc

Source§

fn clone(&self) -> Arc

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Arc

Source§

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

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

impl PartialEq for Arc

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<(&LatLong, &LatLong)> for Arc

Source§

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

Construct an Arc from a pair of positions.

  • params - the start and end positions
Source§

type Error = ArcError

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

impl Validate for Arc

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.

Source§

impl Copy for Arc

Source§

impl StructuralPartialEq for Arc

Auto Trait Implementations§

§

impl Freeze for Arc

§

impl RefUnwindSafe for Arc

§

impl Send for Arc

§

impl Sync for Arc

§

impl Unpin for Arc

§

impl UnwindSafe for Arc

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<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.
Source§

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