Core 1.0
Public Member Functions | List of all members
Line Class Reference

A line defined by two points. More...

#include <segment.h>

Inheritance diagram for Line:
Segment

Public Member Functions

 Line ()
 Empty.
 
 Line (const Vector &, const Vector &)
 Creates a line. More...
 
Vector Vertex (int) const
 Return one of the vertices of the line.
 
VectorVertex (int)
 Return one of the vertices of the line.
 
double R (const Vector &) const
 Compute the squared distance to the line. More...
 
double R (const Line &) const
 Compute the squared distance between two lines. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Segment
 Segment ()
 Empty.
 
 Segment (const Vector &, const Vector &)
 Creates a segment given its end vertices. More...
 
 ~Segment ()
 Empty.
 
void Rotate (const Matrix &)
 Rotates a segment. More...
 
void Translate (const Vector &)
 Translates a segment. More...
 
void Scale (const double &)
 Uniformly scales a segment. More...
 
Segment Translated (const Vector &) const
 Translates a segment. More...
 
Segment Scaled (const Vector &) const
 Scales a segment. More...
 
Segment Scaled (const double &) const
 Uniformly scales a segment. More...
 
Segment Rotated (const Matrix &) const
 Rotates a segment. More...
 
Segment InverseTransformed (const Frame &) const
 Inverse transformation. More...
 
Quadric Equation (const Ray &) const
 Computes the polynomial equation of the Euclidean distance between a ray and the line corresponding to the segment. More...
 
Vector Vertex (int) const
 Return one of the end vertex of the axis.
 
VectorVertex (int)
 Return one of the end vertex of the axis.
 
Vector VertexAt (const double &) const
 Compute a point on the segment. More...
 
Vector Center () const
 Compute the center of the segment.
 
bool Intersect (const Box &) const
 Check if a segment intersects a box. More...
 
Vector GetAxis () const
 Returns the normalized axis vector.
 
Box GetBox () const
 Compute the bounding box of the segment.
 
double Length () const
 Return axis length.
 
double R (const Vector &) const
 Compute the squared distance to the segment. More...
 
double R (const Vector &, double &) const
 Compute the squared distance to the segment. More...
 
double R (const Segment &) const
 Compute the squared distance between two segments. More...
 
Vector Normal (const Vector &) const
 Compute the normal vector between a point and its projection onto the segment. More...
 
bool Equal (const Segment &, const double &) const
 Test if two segments are almost equal. More...
 
- Static Protected Member Functions inherited from Segment
static Quadric EdgeEquation (const Ray &, const Vector &, const Vector &, const Vector &)
 Compute the polynomial equation of the distance function along the ray. More...
 
static Vector Intersect (const Vector &, const Vector &, const double, const double, double=0.0)
 Compute the intersection between the line f(x)=y and a line such that f(a)=va and f(b)=vb, on the segment ab. More...
 
- Protected Attributes inherited from Segment
Vector b = Vector::Z
 End vertices of the segment.
 

Detailed Description

A line defined by two points.

Constructor & Destructor Documentation

◆ Line()

Line::Line ( const Vector a,
const Vector b 
)
inlineexplicit

Creates a line.

Parameters
a,bTwo points on the line.

Member Function Documentation

◆ R() [1/2]

double Line::R ( const Line line) const

Compute the squared distance between two lines.

Parameters
lineLine.

◆ R() [2/2]

double Line::R ( const Vector p) const

Compute the squared distance to the line.

Parameters
pPoint.