Segment

template<class T>
class Segment
#include <segment.hpp>

Segment defined by its two extremities: A and B.

Public Functions

inline Segment(const Vect2<T> A, const Vect2<T> B)
inline Vect2<T> A() const
inline void setA(const Vect2<T> A)
inline Vect2<T> B() const
inline void setB(const Vect2<T> B)
inline Line<T> toLine() const

Returns a line that contains the extremities of the segment.

inline bool containsPoint(const Vect2<T> M) const

Check if a point belongs to the segment.

template<class U>
inline operator Segment<U>() const

Private Members

Vect2<T> m_A
Vect2<T> m_B