clan::LineSegment2x< Type > Class Template Reference

2D line segment More...

#include <line_segment.h>

Public Member Functions

 LineSegment2x ()
 
 LineSegment2x (const LineSegment2x< Type > &copy)
 
 LineSegment2x (const Vec2< Type > &point_p, const Vec2< Type > &point_q)
 
Attributes
Vec2< Type > get_midpoint () const
 Get the midpoint of this line. More...
 
Type point_distance (const Vec2< Type > &point)
 Return the distance from a point to a line. More...
 
bool collinear (const LineSegment2x< Type > &second) const
 Return true if two line segments are collinear. (All points are on the same line.) More...
 
bool intersects (const LineSegment2x< Type > &second, bool collinear_intersect) const
 Return true if two line segments intersect. More...
 
Vec2< Type > get_intersection (const LineSegment2x< Type > &second, bool &intersect) const
 Return the intersection point of two lines. More...
 
Type point_right_of_line (const Vec2< Type > &point) const
 Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B. More...
 
Vec2< Type > normal () const
 Return the normal vector of the line from point A to point B. More...
 
Operations
LineSegment2x< Type > & clip (const Rectx< Type > &rect, bool &clipped)
 Clip this line to a rectangle. More...
 
Operators
LineSegment2x< Type > & operator= (const LineSegment2x< Type > &copy)
 = operator. More...
 
bool operator== (const LineSegment2x< Type > &line) const
 == operator. More...
 
bool operator!= (const LineSegment2x< Type > &line) const
 != operator. More...
 

Public Attributes

Vec2< Type > p
 Start point on the line. More...
 
Vec2< Type > q
 

Detailed Description

template<typename Type>
class clan::LineSegment2x< Type >

2D line segment

A line segment has a start point and an end point
These line templates are defined for: int (LineSegment2i), float (LineSegment2f), double (LineSegment2d)


The documentation for this class was generated from the following file: