template class EE::Math::Line2

Overview

#include <line2.hpp>

template <typename T>
class Line2 {
public:
    // fields

    Vector2<T> V[2];

    // construction

    Line2();
    Line2(const Vector2<T>& v1, const Vector2<T>& v2);

    // methods

    Vector2<T>& p1();
    Vector2<T>& p2();
    Vector2<T> getNormal();
    T getAngle();
    bool intersect(Line2<T>& line, T* X = NULL, T* Y = NULL);
};

Detailed Documentation

Methods

T getAngle()

Returns:

The angle of the line against the x axis-aligned line

bool intersect(Line2<T>& line, T* X = NULL, T* Y = NULL)

Determine if two lines are intersecting

Parameters:

line

The line to intersect

X

Optional Pointer returning the X point position of intersection

Y

Optional Pointer returning the Y point position of intersection

Returns:

True if the lines are intersecting