Tuple Fields
0: Point<N>
1: Point<N>
Implementations
sourceimpl<N: Num> Line<N>
impl<N: Num> Line<N>
pub fn new_from_points(points: &[N]) -> Self
pub fn new_zero_value() -> Self
pub fn start(self) -> Point<N>
pub fn end(self) -> Point<N>
pub fn min_point(self) -> Point<N>
pub fn max_point(self) -> Point<N>
pub fn left_x(self) -> N
pub fn right_x(self) -> N
pub fn bottom_y(self) -> N
pub fn top_y(self) -> N
pub fn is_horizontal(self) -> bool
pub fn is_vertical(self) -> bool
pub fn is_straight(self) -> bool
sourcepub fn to<T: Num + From<N>>(&self) -> Line<T>
pub fn to<T: Num + From<N>>(&self) -> Line<T>
This is to allow creating a new Point, with a new type, from the type given.
i.e. Point::new(1 as u8, 1 as u8)::to::<u32>()
pub fn to_rect(self) -> Rect<N>
sourcepub fn interpolation_point(self, n: N) -> Point<N>
pub fn interpolation_point(self, n: N) -> Point<N>
Where n
is a valid from 0.0 to 1.0,
this will return a point on the length of the line.
pub fn is_direction_negative_x(self) -> bool
pub fn is_direction_positive_x(self) -> bool
pub fn is_direction_negative_y(self) -> bool
pub fn is_direction_positive_y(self) -> bool
pub fn abs(&self) -> Self
pub fn min(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
pub fn min_x(self) -> N
pub fn min_y(self) -> N
pub fn max_x(self) -> N
pub fn max_y(self) -> N
pub fn overlaps_line(self, other: Line<N>) -> bool
pub fn overlaps_circle(self, other: Circle<N>) -> bool
pub fn intersect_line(self, other: Line<N>) -> Option<Point<N>>
sourcepub fn intersect_rect(self, rect: Rect<N>) -> Option<Line<N>>
pub fn intersect_rect(self, rect: Rect<N>) -> Option<Line<N>>
Calculates if this overlaps another rectangle. If it does, it will return the part of the line that intersects within that rectangle.
None
is returned when no intersection is found.
pub fn direction(self) -> Size<f32>
pub fn hypot(self) -> N
pub fn hypot_sqrd(self) -> N
pub fn rotate(self, angle: f32) -> Self
pub fn rotate_around_zero(self, angle: f32) -> Self
pub fn rotate_around_point(self, angle: f32, target: Point<N>) -> Self
pub fn rotate_around_start(self, angle: f32) -> Self
pub fn rotate_around_end(self, angle: f32) -> Self
pub fn midpoint(self) -> Point<N>
sourcepub fn flip(self) -> Self
pub fn flip(self) -> Self
Returns a line where the start is at the end, and the end is at the start.
pub fn into_iter_with_step(self, step: N) -> LineIterator<N>ⓘNotable traits for LineIterator<N>impl<N: Num> Iterator for LineIterator<N> type Item = Point<N>;
pub fn into_iter_inclusive(self) -> LineIterator<N>ⓘNotable traits for LineIterator<N>impl<N: Num> Iterator for LineIterator<N> type Item = Point<N>;
pub fn into_iter_inclusive_with_step(self, step: N) -> LineIterator<N>ⓘNotable traits for LineIterator<N>impl<N: Num> Iterator for LineIterator<N> type Item = Point<N>;
pub fn into_slice(self) -> [N; 4]
sourceimpl<N: Num + ToSignedClamped> Line<N> where
<N as ToSignedClamped>::Output: Signed,
impl<N: Num + ToSignedClamped> Line<N> where
<N as ToSignedClamped>::Output: Signed,
pub fn to_signed_clamped(self) -> Line<<N as ToSignedClamped>::Output>
pub fn diff(self) -> Size<<N as ToSignedClamped>::Output>
pub fn x_diff(self) -> <N as ToSignedClamped>::Output
pub fn y_diff(self) -> <N as ToSignedClamped>::Output
pub fn slope(self) -> <N as ToSignedClamped>::Output
pub fn inverse_slope(self) -> <N as ToSignedClamped>::Output
pub fn step_direction(self) -> Point<<N as ToSignedClamped>::Output>
Trait Implementations
sourceimpl<N: Num> AddAssign<Line<N>> for Line<N>
impl<N: Num> AddAssign<Line<N>> for Line<N>
sourcefn add_assign(&mut self, other: Line<N>)
fn add_assign(&mut self, other: Line<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> AddAssign<Point<N>> for Line<N>
impl<N: Num> AddAssign<Point<N>> for Line<N>
sourcefn add_assign(&mut self, other: Point<N>)
fn add_assign(&mut self, other: Point<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> DivAssign<Line<N>> for Line<N>
impl<N: Num> DivAssign<Line<N>> for Line<N>
sourcefn div_assign(&mut self, other: Line<N>)
fn div_assign(&mut self, other: Line<N>)
Performs the /=
operation. Read more
sourceimpl<N: Num> DivAssign<N> for Line<N>
impl<N: Num> DivAssign<N> for Line<N>
sourcefn div_assign(&mut self, other: N)
fn div_assign(&mut self, other: N)
Performs the /=
operation. Read more
sourceimpl<N: Num> DivAssign<Point<N>> for Line<N>
impl<N: Num> DivAssign<Point<N>> for Line<N>
sourcefn div_assign(&mut self, other: Point<N>)
fn div_assign(&mut self, other: Point<N>)
Performs the /=
operation. Read more
sourceimpl<N: Num> DivAssign<Size<N>> for Line<N>
impl<N: Num> DivAssign<Size<N>> for Line<N>
sourcefn div_assign(&mut self, other: Size<N>)
fn div_assign(&mut self, other: Size<N>)
Performs the /=
operation. Read more
sourceimpl<N: Num> IntoIterator for Line<N>
impl<N: Num> IntoIterator for Line<N>
sourceimpl<N: Num> MulAssign<Line<N>> for Line<N>
impl<N: Num> MulAssign<Line<N>> for Line<N>
sourcefn mul_assign(&mut self, other: Line<N>)
fn mul_assign(&mut self, other: Line<N>)
Performs the *=
operation. Read more
sourceimpl<N: Num> MulAssign<N> for Line<N>
impl<N: Num> MulAssign<N> for Line<N>
sourcefn mul_assign(&mut self, other: N)
fn mul_assign(&mut self, other: N)
Performs the *=
operation. Read more
sourceimpl<N: Num> MulAssign<Point<N>> for Line<N>
impl<N: Num> MulAssign<Point<N>> for Line<N>
sourcefn mul_assign(&mut self, other: Point<N>)
fn mul_assign(&mut self, other: Point<N>)
Performs the *=
operation. Read more
sourceimpl<N: Num> MulAssign<Size<N>> for Line<N>
impl<N: Num> MulAssign<Size<N>> for Line<N>
sourcefn mul_assign(&mut self, other: Size<N>)
fn mul_assign(&mut self, other: Size<N>)
Performs the *=
operation. Read more
sourceimpl<N: INum> ShlAssign<N> for Line<N>
impl<N: INum> ShlAssign<N> for Line<N>
sourcefn shl_assign(&mut self, other: N)
fn shl_assign(&mut self, other: N)
Performs the <<=
operation. Read more
sourceimpl<N: INum> ShrAssign<N> for Line<N>
impl<N: INum> ShrAssign<N> for Line<N>
sourcefn shr_assign(&mut self, other: N)
fn shr_assign(&mut self, other: N)
Performs the >>=
operation. Read more
sourceimpl<N: Num> SubAssign<Line<N>> for Line<N>
impl<N: Num> SubAssign<Line<N>> for Line<N>
sourcefn sub_assign(&mut self, other: Line<N>)
fn sub_assign(&mut self, other: Line<N>)
Performs the -=
operation. Read more
sourceimpl<N: Num> SubAssign<Point<N>> for Line<N>
impl<N: Num> SubAssign<Point<N>> for Line<N>
sourcefn sub_assign(&mut self, other: Point<N>)
fn sub_assign(&mut self, other: Point<N>)
Performs the -=
operation. Read more
sourceimpl<O: Num, N: Num + ToRounded<O>> ToRounded<Line<O>> for Line<N>
impl<O: Num, N: Num + ToRounded<O>> ToRounded<Line<O>> for Line<N>
sourcefn to_rounded(self) -> Line<O>
fn to_rounded(self) -> Line<O>
Returns the value in the new type, but clamped.
impl<N: Copy + Num> Copy for Line<N>
impl<N: Num> StructuralPartialEq for Line<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Line<N> where
N: RefUnwindSafe,
impl<N> Send for Line<N> where
N: Send,
impl<N> Sync for Line<N> where
N: Sync,
impl<N> Unpin for Line<N> where
N: Unpin,
impl<N> UnwindSafe for Line<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more