Utilities
Utilities header only library
geom::LineSegment< N > Struct Template Reference

Template line segment in an arbitrary dimension. More...

Inheritance diagram for geom::LineSegment< N >:
[legend]

Public Types

using Vec = glm::vec< N, float >
 

Public Member Functions

 LineSegment (const Vec &init_point1, const Vec &init_point2)
 
float GetLength () const
 Returns length of line segment = distance between point1 and point2.
 
float GetLengthSqr () const
 Returns square length of line segment = square distance between point1 and point2.
 
Vec GetDirection () const
 Returns direction of the line as a normalized vector from point1 to point2.
 
Vec ToVector () const
 Converts the line to the vector from point1 to point2.
 

Data Fields

Vec point1
 
Vec point2
 

Detailed Description

template<size_t N>
struct geom::LineSegment< N >

Template line segment in an arbitrary dimension.