Trait flo_curves::Line

source ·
pub trait Line: Geo {
    fn from_points(p1: Self::Point, p2: Self::Point) -> Self;
    fn points(&self) -> (Self::Point, Self::Point);

    fn point_at_pos(&self, t: f64) -> Self::Point { ... }
    fn pos_for_point(&self, point: &Self::Point) -> f64 { ... }
}
Expand description

Represents a straight line

Required Methods

Creates a new line from points

Returns the two points that mark the start and end of this line

Provided Methods

Given a value ‘t’ from 0 to 1, returns the point at that position along the line

Given a point (assumed to be on the line), returns the ‘t’ value on the line

If the point is not on the line, this will return a t value where at least one of the components of the point matches with the point on the line.

Implementations on Foreign Types

Simplest line is just a tuple of two points

Creates a new line from points

Returns the two points that mark the start and end of this line

Implementors