Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Public Attributes | List of all members
castor::Line2D< T > Class Template Reference

2D line equation More...

#include <Line2D.hpp>

Public Member Functions

 Line2D (T xA, T yA, T xB, T yB)
 Constructor.
 
bool intersects (Line2D const &line, T &x, T &y)
 Computes intersection between this line and another one.
 

Public Attributes

a
 
b
 

Detailed Description

template<typename T>
class castor::Line2D< T >

2D line equation

Remarks
do you remember y = ax + b ?

Constructor & Destructor Documentation

◆ Line2D()

template<typename T >
castor::Line2D< T >::Line2D ( T xA,
T yA,
T xB,
T yB )
inline

Constructor.

Parameters
[in]xA,yAThe coordinates of point A of the line
[in]xB,yBThe coordinates of point B of the line

Member Function Documentation

◆ intersects()

template<typename T >
bool castor::Line2D< T >::intersects ( Line2D< T > const & line,
T & x,
T & y )
inline

Computes intersection between this line and another one.

Parameters
[in]lineThe other line
[out]x,yReceive the intersection point coordinates
Returns
true if an intersection exists

References castor::Line2D< T >::a, and castor::Line2D< T >::b.

Member Data Documentation

◆ a

template<typename T >
T castor::Line2D< T >::a

The slope.

Referenced by castor::Line2D< T >::intersects().

◆ b

template<typename T >
T castor::Line2D< T >::b

The offset.

Referenced by castor::Line2D< T >::intersects().


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