clan::Line2x< Type > Class Template Reference - ClanLib SDK
Description: clan::Line2x< Type > Class Template Reference

Public Member Functions | Public Attributes | List of all members
clan::Line2x< Type > Class Template Reference
clanCore Math

2D line More...

`#include <line.h>`

## Public Member Functions
| Line2x ()
| Line2x (const Line2x< Type > &copy)=default
| Line2x (const Vec2< Type > &point_p, const Vec2< Type > &point_q)
| Line2x (const Vec2< Type > &point_p, Type gradient)
Vec2< Type > | get_intersection (const Line2x< Type > &second, bool &intersect) const
| Return the intersection of this and other line.
bool | operator!= (const Line2x< Type > &line) const
| != operator.
Line2x< Type > & | operator= (const Line2x< Type > &copy)=default
| = operator.
bool | operator== (const Line2x< Type > &line) const
| == operator.
Type | point_right_of_line (Vec2< Type > point) const
| Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.

## Public Attributes
Vec2< Type > | p
| First point on the line.
Vec2< Type > | q

## Detailed Description

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

2D line

These line templates are defined for: int (Line2i), float (Line2f), double (Line2d)

## Constructor & Destructor Documentation

## ◆ Line2x() [1/4]

template<typename Type>

clan::Line2x< Type >::Line2x | ( |  | ) |
| inline

References p, and q.

Referenced by Line2x(), get_intersection(), operator!=(), operator=(), and operator==().

## ◆ Line2x() [2/4]

template<typename Type>

clan::Line2x< Type >::Line2x | ( | const Line2x< Type > & | copy | ) |
| default

References Line2x().

## ◆ Line2x() [3/4]

template<typename Type>

clan::Line2x< Type >::Line2x | ( | const Vec2< Type > & | point_p,
|  | const Vec2< Type > & | point_q )
| inline

References p, and q.

## ◆ Line2x() [4/4]

template<typename Type>

clan::Line2x< Type >::Line2x | ( | const Vec2< Type > & | point_p,
|  | Type | gradient )
| inline

References p, and q.

## Member Function Documentation

## ◆ get_intersection()

template<typename Type>

Vec2< Type > clan::Line2x< Type >::get_intersection | ( | const 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

References Line2x().

## ◆ operator!=()

template<typename Type>

bool clan::Line2x< Type >::operator!= | ( | const Line2x< Type > & | line | ) | const
| inline

!= operator.

References Line2x(), clan::line, p, and q.

## ◆ operator=()

template<typename Type>

Line2x< Type > & clan::Line2x< Type >::operator= | ( | const Line2x< Type > & | copy | ) |
| default

= operator.

References Line2x().

## ◆ operator==()

template<typename Type>

bool clan::Line2x< Type >::operator== | ( | const Line2x< Type > & | line | ) | const
| inline

== operator.

References Line2x(), clan::line, p, and q.

## ◆ point_right_of_line()

template<typename Type>

Type clan::Line2x< Type >::point_right_of_line | ( | 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)

References p, clan::point, and q.

## Member Data Documentation

## ◆ p

template<typename Type>

Vec2<Type> clan::Line2x< Type >::p

First point on the line.

Referenced by Line2x(), Line2x(), Line2x(), operator!=(), operator==(), and point_right_of_line().

## ◆ q

template<typename Type>

Vec2<Type> clan::Line2x< Type >::q

Referenced by Line2x(), Line2x(), Line2x(), operator!=(), operator==(), and point_right_of_line().

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

- line.h