clan::LineSegment2d Class Reference

2D line segment - Double More...

#include <line_segment.h>

+ Inheritance diagram for clan::LineSegment2d:

Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from clan::LineSegment2x< double >
Vec2< double > p
 Start point on the line.
 
Vec2< double > q
 

Detailed Description

2D line segment - Double

A line segment has a start point and an end point

Constructor & Destructor Documentation

◆ LineSegment2d() [1/3]

clan::LineSegment2d::LineSegment2d ( )
inline

◆ LineSegment2d() [2/3]

clan::LineSegment2d::LineSegment2d ( const LineSegment2x< double > &  copy)
inline

◆ LineSegment2d() [3/3]

clan::LineSegment2d::LineSegment2d ( const Vec2< double > &  point_p,
const Vec2< double > &  point_q 
)
inline

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