29#ifndef _STRAIGHT_2T_H_
30#define _STRAIGHT_2T_H_
32#include <tmath/v2_t.h>
39 {
p.x = x;
p.y =
y;
d.x = dx;
d.y = dy;
d.normalize(); }
41 {
p = anchor;
d = dir;
d.normalize(); }
56 T t = -(
d.x*(s.
p.y-
p.y)+
d.y*(
p.x-s.
p.x))/(
d.x*s.
d.y-
d.y*s.
d.x);
v2t< T > intersect(const straight2t< T > &s) const
straight2t(T x, T y, T dx, T dy)
straight2t(const v2t< T > &anchor, const v2t< T > &dir)
T dist(const v2t< T > &p) const