libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Private Attributes | List of all members
Line< N > Class Template Reference

Detailed Description

template<uint N>
class Line< N >

Line in euclidian space.

Line is constructed with two points. These points can be modified later using the setPoints() method. Parametric evaluation is defined so that parameter value 0 yields the first point, parameter 1 the second point.

Lines are infinite: Parameters t can take any value. [ { r} = { p}_1 + t ({ p}_2 - { p}_1) ]

This class provides methods to find the projection of a point on the line (foot()), compute the intersection of lines and determine the parameter which belongs to a point lying on the line.

#include <line.h>

Collaboration diagram for Line< N >:
[legend]

Public Member Functions

 Line ()
 default constructor
 
template<typename FloatType >
 Line (const SVector< N, FloatType > &a, const SVector< N, FloatType > &b)
 through two points
 
void setPoints (const SVector< N > &a, const SVector< N > &b)
 set new points
 
SVector< N > eval (Real t) const
 returns point on line; t in (-infty, +infty)
 
SVector< N > direction () const
 direction vector
 
bool isParallel (const Line< N > &ln) const
 true if lines are parallel
 
SVector< N > foot (const SVector< N > &p) const
 returns the perpendicular projection of p on the line
 
Real footPar (const SVector< N > &p) const
 parameter of the projection point
 
Real distance (const SVector< N > &p) const
 calculates the minimum distance of p from line
 
LnIts< N > intersection (const Line< N > &ln) const
 parameters of intersection point
 

Private Attributes

SVector< N > p1
 direction of positive parameters is p1->p2
 

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