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

Auto Trait Implementations§

§

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