Public Member Functions | Public Attributes

Line3 Class Reference

A Line3 is a line in space, with the equations: More...

List of all members.

Public Member Functions

 Line3 ()
 Line3 (double x0, double y0, double z0, double alpha, double beta, double gamma)
 Line3 (const Coord3 &, const Vector3 &)
Vector3 direction (bool normalize=true) const
Coord3 getPoint (double t) const
bool intersectWith (const Plane3 &, double &t) const
double distanceToPoint (const Coord3 &point) const
double sqDistanceToPoint (const Coord3 &point) const
double closestPoint (const Coord3 &point) const
bool closestPoint (const Line3 &line, double &t_this, double &t_line) const

Public Attributes

double x0_
double y0_
double z0_
double alpha_
double beta_
double gamma_

Detailed Description

A Line3 is a line in space, with the equations:

x = x0 + alpha*t y = y0 + beta*t z = z0 + gamma*t


Constructor & Destructor Documentation

Line3::Line3 (  ) 
Line3::Line3 ( double  x0,
double  y0,
double  z0,
double  alpha,
double  beta,
double  gamma 
)
Line3::Line3 ( const Coord3 ,
const Vector3  
)

Member Function Documentation

double Line3::closestPoint ( const Coord3 point  )  const
Returns:
the point on the line that is closest to the given point
bool Line3::closestPoint ( const Line3 line,
double &  t_this,
double &  t_line 
) const
Returns:
the t for the point point on the line that is closest to the given line
Vector3 Line3::direction ( bool  normalize = true  )  const [inline]
double Line3::distanceToPoint ( const Coord3 point  )  const
Coord3 Line3::getPoint ( double  t  )  const
bool Line3::intersectWith ( const Plane3 ,
double &  t 
) const

Calculates the intersection between the line and the plane. If success, it sets t.

double Line3::sqDistanceToPoint ( const Coord3 point  )  const

Member Data Documentation

double Line3::alpha_
double Line3::beta_
double Line3::gamma_
double Line3::x0_
double Line3::y0_
double Line3::z0_