pub struct Line2f {
pub points: (Vec2f, Vec2f),
}Fields§
§points: (Vec2f, Vec2f)Implementations§
Source§impl Line2f
impl Line2f
pub fn new(a: Vec2f, b: Vec2f) -> Line2f
pub fn reverse(self) -> Line2f
pub fn closest_parametric_point(self, point: Vec2f) -> f32
pub fn point_distance_squared(self, point: Vec2f) -> f32
pub fn cart_from_para(self, t: f32) -> Vec2f
Sourcepub fn orient(self, point: Vec2f) -> f32
pub fn orient(self, point: Vec2f) -> f32
If result is greater than zero point lies to the left of the
line. If result is less than zero point lies to the
right. If result is zero, the point is on the line.
The value is also twice the signed area of the triangle
(points.0, points.1, point) (positive if counterclockwise,
otherwise negative).
Adapted from “Real-Time Collision Detection” by Christer Ericson, published by Morgan Kaufmann Publishers, Copyright 2005 Elsevier Inc
Trait Implementations§
impl Copy for Line2f
impl StructuralPartialEq for Line2f
Auto Trait Implementations§
impl Freeze for Line2f
impl RefUnwindSafe for Line2f
impl Send for Line2f
impl Sync for Line2f
impl Unpin for Line2f
impl UnwindSafe for Line2f
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more