Struct unit_sphere::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 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

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.

Trait Implementations§

source§

impl Clone for Arc

source§

fn clone(&self) -> Arc

Returns a copy 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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
§

type Error = &'static str

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 >= 0.0.

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: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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

§

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,

§

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>,

§

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>,

§

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,