Struct dumbmath::vec2f::Line2f [] [src]

pub struct Line2f {
    pub points: (Vec2f, Vec2f),
}

Fields

points

Methods

impl Line2f

fn new(a: Vec2f, b: Vec2f) -> Line2f

fn reverse(self) -> Line2f

fn closest_parametric_point(self, point: Vec2f) -> f32

fn point_distance_squared(self, point: Vec2f) -> f32

fn cart_from_para(self, t: f32) -> Vec2f

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

Derived Implementations

impl PartialEq for Line2f

fn eq(&self, __arg_0: &Line2f) -> bool

fn ne(&self, __arg_0: &Line2f) -> bool

impl Debug for Line2f

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for Line2f

impl Clone for Line2f

fn clone(&self) -> Line2f

fn clone_from(&mut self, source: &Self)