[−][src]Trait lyon_geom::traits::Segment
Common APIs to segment types.
Associated Types
type Scalar: Scalar
Required methods
fn from(&self) -> Point<Self::Scalar>
Start of the curve.
fn to(&self) -> Point<Self::Scalar>
End of the curve.
fn sample(&self, t: Self::Scalar) -> Point<Self::Scalar>
Sample the curve at t (expecting t between 0 and 1).
fn derivative(&self, t: Self::Scalar) -> Vector<Self::Scalar>
Sample the derivative at t (expecting t between 0 and 1).
fn split(&self, t: Self::Scalar) -> (Self, Self)
Split this curve into two sub-curves.
fn before_split(&self, t: Self::Scalar) -> Self
Return the curve before the split point.
fn after_split(&self, t: Self::Scalar) -> Self
Return the curve after the split point.
fn split_range(&self, t_range: Range<Self::Scalar>) -> Self
Return the curve inside a given range of t.
This is equivalent splitting at the range's end points.
fn flip(&self) -> Self
Swap the direction of the segment.
fn approximate_length(&self, tolerance: Self::Scalar) -> Self::Scalar
Compute the length of the segment using a flattened approximation.
Provided methods
fn x(&self, t: Self::Scalar) -> Self::Scalar
Sample x at t (expecting t between 0 and 1).
fn y(&self, t: Self::Scalar) -> Self::Scalar
Sample y at t (expecting t between 0 and 1).
fn dx(&self, t: Self::Scalar) -> Self::Scalar
Sample x derivative at t (expecting t between 0 and 1).
fn dy(&self, t: Self::Scalar) -> Self::Scalar
Sample y derivative at t (expecting t between 0 and 1).