Skip to main content

LinearSegment

Struct LinearSegment 

Source
pub struct LinearSegment {
    pub start: Pose,
    pub length: f64,
}
Available on crate feature path-traits only.
Expand description

A straight-line segment starting at start with given length.

The heading stays constant along the segment.

Fields§

§start: Pose

Starting pose (position and heading).

§length: f64

Arc-length of the segment.

Trait Implementations§

Source§

impl Clone for LinearSegment

Source§

fn clone(&self) -> LinearSegment

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 Curved for LinearSegment

Source§

type Curvature = f64

The type representing curvature (scalar in 2D, vector in 3D).
Source§

fn curvature_at(&self, s: f64) -> Result<Self::Curvature, Self::Error>

Curvature at arc-length s. Read more
Source§

impl Debug for LinearSegment

Source§

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

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

impl FrenetFrame for LinearSegment

Source§

type Frame = (Vec2, Vec2)

Frame type, e.g. (Tangent, Normal) in 2D or (T, N, B) in 3D.
Source§

fn frame_at(&self, s: f64) -> Result<Self::Frame, Self::Error>

Frenet frame at arc-length s. Read more
Source§

impl Heading for LinearSegment

Source§

fn heading_at(&self, s: f64) -> Result<f64, Self::Error>

Planar heading angle (radians) at arc-length s. Read more
Source§

impl ParametricPath for LinearSegment

Source§

fn sample_t(&self, t: f64) -> Result<Self::Point, Self::Error>

Sample the path at normalized parameter t ∈ [0, 1]. Read more
Source§

fn t_to_s(&self, t: Self::Scalar) -> Self::Scalar

Convert normalized parameter t to arc-length s. Read more
Source§

fn s_to_t(&self, s: Self::Scalar) -> Self::Scalar

Convert arc-length s to normalized parameter t. Read more
Source§

impl Path for LinearSegment

Source§

type Point = Point2

The point type representing positions on the path.
Source§

type Error = PathError<f64>

The error type for fallible operations. Must be convertible from PathError<Self::Scalar>.
Source§

type Scalar = f64

The scalar type for arc-length, parameter, and distance computations.
Source§

fn length(&self) -> f64

Total arc-length of the path.
Source§

fn sample_at(&self, s: f64) -> Result<Self::Point, Self::Error>

Sample the path at arc-length s ∈ [0, length]. Read more
Source§

fn start(&self) -> Result<Self::Point, Self::Error>

The start point of the path, equivalent to sample_at(0).
Source§

fn end(&self) -> Result<Self::Point, Self::Error>

The end point of the path, equivalent to sample_at(length).
Source§

fn domain(&self) -> RangeInclusive<Self::Scalar>

The valid domain for arc-length sampling: [0, length].
Source§

impl Project for LinearSegment

Source§

fn project(&self, p: Self::Point) -> Result<f64, Self::Error>

Find the arc-length s of the point on the path closest to p. Read more
Source§

fn closest_point(&self, p: Self::Point) -> Result<Self::Point, Self::Error>

Return the closest point on the path to p. Read more
Source§

impl Tangent for LinearSegment

Source§

fn tangent_at( &self, s: f64, ) -> Result<<Self::Point as Point>::Vector, Self::Error>

Unit tangent vector at arc-length s. Read more
Source§

impl Copy for LinearSegment

Source§

impl PathSegment for LinearSegment

Auto Trait Implementations§

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<P> PathExt for P
where P: Path,

Source§

fn reverse(self) -> Reverse<P>

Reverse the path direction.
Source§

fn concat<Q>(self, other: Q) -> Concat<P, Q>
where Q: Path<Scalar = <P as Path>::Scalar, Point = <P as Path>::Point, Error = <P as Path>::Error>,

Concatenate this path with another, compatible path.
Source§

fn offset(self, d: <P as Path>::Scalar) -> Offset<P, <P as Path>::Scalar>
where P: Tangent + Heading,

Offset the path by a distance d. Requires tangent and heading support.
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.