AngelCAD  1.5-00
Public Member Functions | List of all members
line2d Class Reference

2d line More...

#include <angelcad.h>

Public Member Functions

 line2d (const pos2d@ p1, const pos2d@ p2)
 Construct line segment from p1 to p2. More...
 
double length () const
 Compute length of line segment. More...
 
double project (pos2d@ point) const
 Project point onto line segment and return line parameter of projetion point. More...
 
pos2d@ end1 () const
 Return 1st end point on line segment. More...
 
pos2d@ end2 () const
 Return 2nd end point on line segment. More...
 
pos2d@ interpolate (double par) const
 Compute point on (infinite) line given line segment parameter (0=end1, 1=end2) More...
 

Detailed Description

2d line

Constructor & Destructor Documentation

◆ line2d()

line2d::line2d ( const pos2d@  p1,
const pos2d@  p2 
)

Construct line segment from p1 to p2.

Parameters
p1pos2d@, Line segment start point, corresponds to parameter=0.0
p2pos2d@, Line segment end point, corresponds to parameter=1.0

Member Function Documentation

◆ end1()

pos2d@ line2d::end1 ( ) const

Return 1st end point on line segment.

Returns
pos2d@

◆ end2()

pos2d@ line2d::end2 ( ) const

Return 2nd end point on line segment.

Returns
pos2d@

◆ interpolate()

pos2d@ line2d::interpolate ( double  par) const

Compute point on (infinite) line given line segment parameter (0=end1, 1=end2)

Parameters
pardouble, Interpolation parameter value
Returns
pos2d@

◆ length()

double line2d::length ( ) const

Compute length of line segment.

Returns
double

◆ project()

double line2d::project ( pos2d@  point) const

Project point onto line segment and return line parameter of projetion point.

Parameters
pointpos2d@, Point to be projected onto line
Returns
double

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