Easy3D 2.5.3
GenericLine< DIM, FT > Class Template Reference

A generic line representation, which supports both 2D and 3D lines. More...

#include <easy3d/core/line.h>

Public Types

typedef Vec< DIM, FT > Point
 
typedef Vec< DIM, FT > Vector
 
typedef GenericLine< DIM, FT > thisclass
 

Public Member Functions

 GenericLine ()=default
 Default constructor.
 
void set (const Point &p, const Vector &dir)
 Sets a line from a point p and its direction dir.
 
const Vectordirection () const
 Returns the direction of a line.
 
const Pointpoint () const
 Returns an arbitrary point on a line.
 
Point projection (const Point &p) const
 Returns the projection of a point p on this line.
 
FT squared_distance (const Point &p) const
 Returns the squared distance of a point p to this line.
 
bool feet (const thisclass &other, Point &p1, Point &p2) const
 Computes the perpendicular feet with another line. More...
 

Static Public Member Functions

static GenericLine from_point_and_direction (const Point &p, const Vector &dir)
 Constructs a line from a point p and its direction dir.
 
static GenericLine from_two_points (const Point &p, const Point &q)
 Constructs a line from two points p and q.
 

Detailed Description

template<int DIM, typename FT>
class easy3d::GenericLine< DIM, FT >

A generic line representation, which supports both 2D and 3D lines.

Member Function Documentation

◆ feet()

bool feet ( const thisclass other,
Point p1,
Point p2 
) const
inline

Computes the perpendicular feet with another line.

Parameters
otherAnother line.
p1The perpendicular foot on the current line.
p2The perpendicular foot on the other line.
Returns
true if the perpendicular foots exist, and false if the two lines are parallel.
Note
This function is for 3D only.

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