49 : origin(that.origin), direction(that.direction)
63 : origin(_origin), direction(_direction)
79 : origin(ox, oy), direction(dx, dy)
104 return !( direction.dot_product( that.
direction ) );
119 if ( ! parallel( that ) )
124 n = direction.x * delta.
y - direction.y * delta.
x;
143 return (direction.y * (x - origin.x) + direction.x * origin.y) / direction.x;
A straight line in a two dimensional space.
bool parallel(const self_type &that) const
Tell if two lines are parallels.
bool orthogonal(const self_type &that) const
Tell if two lines are orthogonal.
point_type origin
A reference point on the line.
T value_type
The type of the values we store.
value_type y
Y-coordinate.
value_type y_value(const value_type &x) const
Get the y value of the point of the line at position x.
direction_type direction
Direction.
value_type x
X-coordinate.
point_type intersection(const self_type &that) const
Get the point at the intersection of two lines.