Public Member Functions | Public Attributes

CL_Line2x< Type > Class Template Reference
[clanCore Math]

2D line More...

#include <line.h>

Inheritance diagram for CL_Line2x< Type >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CL_Line2x ()
 CL_Line2x (const CL_Vec2< Type > &point_p, Type gradient)
 CL_Line2x (const CL_Vec2< Type > &point_p, const CL_Vec2< Type > &point_q)
 CL_Line2x (const CL_Line2x< Type > &copy)
Attributes

CL_Vec2< Type > get_intersection (const CL_Line2x< Type > &second, bool &intersect) const
 Return the intersection of this and other line.
Type point_right_of_line (CL_Vec2< Type > point) const
 Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.
Operators

CL_Line2x< Type > & operator= (const CL_Line2x< Type > &copy)
 = operator.
bool operator== (const CL_Line2x< Type > &line) const
 == operator.
bool operator!= (const CL_Line2x< Type > &line) const
 != operator.

Public Attributes

CL_Vec2< Type > p
 First point on the line.
CL_Vec2< Type > q

Detailed Description

template<typename Type>
class CL_Line2x< Type >

2D line

These line templates are defined for: int (CL_Line2i), float (CL_Line2f), double (CL_Line2d)


Constructor & Destructor Documentation

template<typename Type>
CL_Line2x< Type >::CL_Line2x (  )  [inline]
template<typename Type>
CL_Line2x< Type >::CL_Line2x ( const CL_Line2x< Type > &  copy  )  [inline]
template<typename Type>
CL_Line2x< Type >::CL_Line2x ( const CL_Vec2< Type > &  point_p,
const CL_Vec2< Type > &  point_q 
) [inline]
template<typename Type>
CL_Line2x< Type >::CL_Line2x ( const CL_Vec2< Type > &  point_p,
Type  gradient 
) [inline]

Member Function Documentation

template<typename Type>
CL_Vec2<Type> CL_Line2x< Type >::get_intersection ( const CL_Line2x< Type > &  second,
bool &  intersect 
) const

Return the intersection of this and other line.

Parameters:
second = The second line to use
intersect = On Return: true if the lines intersect, false if the lines are parallel
Returns:
The point
template<typename Type>
bool CL_Line2x< Type >::operator!= ( const CL_Line2x< Type > &  line  )  const [inline]

!= operator.

template<typename Type>
CL_Line2x<Type>& CL_Line2x< Type >::operator= ( const CL_Line2x< Type > &  copy  )  [inline]

= operator.

template<typename Type>
bool CL_Line2x< Type >::operator== ( const CL_Line2x< Type > &  line  )  const [inline]

== operator.

template<typename Type>
Type CL_Line2x< Type >::point_right_of_line ( CL_Vec2< Type >  point  )  const [inline]

Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.

Parameters:
point = The point
Returns:
Value representing - left (>0), centre (=0), or right (<0)

Member Data Documentation

template<typename Type>
CL_Vec2<Type> CL_Line2x< Type >::p
template<typename Type>
CL_Vec2<Type> CL_Line2x< Type >::q

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