clan::LineSegment2f Class Reference - ClanLib SDK
Description: clan::LineSegment2f Class Reference

Public Member Functions | List of all members
clan::LineSegment2f Class Reference
clanCore Math

2D line segment - Float More...

`#include <line_segment.h>`

Inheritance diagram for clan::LineSegment2f:

## Public Member Functions
| LineSegment2f ()
| LineSegment2f (const LineSegment2x< float > &copy)
| LineSegment2f (const Vec2< float > &point_p, const Vec2< float > &point_q)
Public Member Functions inherited from clan::LineSegment2x< float >
| LineSegment2x ()
| LineSegment2x (const LineSegment2x< float > &copy)
| LineSegment2x (const Vec2< float > &point_p, const Vec2< float > &point_q)
LineSegment2x< float > & | clip (const Rectx< float > &rect, bool &clipped)
| Clip this line to a rectangle.
bool | collinear (const LineSegment2x< float > &second) const
| Return true if two line segments are collinear. (All points are on the same line.)
Vec2< float > | get_intersection (const LineSegment2x< float > &second, bool &intersect) const
| Return the intersection point of two lines.
Vec2< float > | get_midpoint () const
| Get the midpoint of this line.
bool | intersects (const LineSegment2x< float > &second, bool collinear_intersect) const
| Return true if two line segments intersect.
Vec2< float > | normal () const
| Return the normal vector of the line from point A to point B.
bool | operator!= (const LineSegment2x< float > &line) const
| != operator.
LineSegment2x< float > & | operator= (const LineSegment2x< float > &copy)
| = operator.
bool | operator== (const LineSegment2x< float > &line) const
| == operator.
float | point_distance (const Vec2< float > &point)
| Return the distance from a point to a line.
float | point_right_of_line (const Vec2< float > &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< float >
Vec2< float > | p
| Start point on the line.
Vec2< float > | q

## Detailed Description

2D line segment - Float

A line segment has a start point and an end point

## Constructor & Destructor Documentation

## ◆ LineSegment2f() [1/3]

clan::LineSegment2f::LineSegment2f | ( |  | ) |
| inline

## ◆ LineSegment2f() [2/3]

clan::LineSegment2f::LineSegment2f | ( | const LineSegment2x< float > & | copy | ) |
| inline

## ◆ LineSegment2f() [3/3]

clan::LineSegment2f::LineSegment2f | ( | const Vec2< float > & | point_p,
|  | const Vec2< float > & | point_q )
| inline

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

- line_segment.h