Thea
LineN< N, T > Class Template Reference

A straight line in N-dimensional space, where N is any positive (non-zero) integer and T is a field. More...

`#include <LineN.hpp>`

Inheritance diagram for LineN< N, T >: ## Public Types

typedef LineN< N, T > LineT
N-dimensional straight line. More...

typedef Vector< N, T > VectorT
N-dimensional vector. More...

## Public Member Functions

template<typename U >
LineN< N, U > cast () const
Cast the line to a different scalar type. More...

VectorT closestPoint (VectorT const &p) const
Get the point on the line closest to a given point. More...

distance (VectorT const &p) const
Get the distance of the line from a given point. More...

distance (LineT const &other) const
Get the distance of this line from another line. More...

VectorT const & getDirection () const
Get the unit direction vector of the line. More...

VectorT const & getPoint () const
Get a point on the line. More...

squaredDistance (VectorT const &p) const
Get the square of the distance of the line from a given point. More...

squaredDistance (LineT const &other, VectorT *this_pt=nullptr, VectorT *other_pt=nullptr) const
Get the point on this line and the point on another line closest to each other, and return the squared distance between them. More...

std::string toString () const
Get a textual description of the line. More...

## Static Public Member Functions

static LineT fromPointAndDirection (VectorT const &point_, VectorT const &direction_, bool normalize=true)
Construct a line from a point on it, and the direction vector of the line (need not be a unit vector). More...

static LineT fromTwoPoints (VectorT const &point1, VectorT const &point2)
Construct a line from two points on it. More...

## Detailed Description

### template<int N, typename T = Real> class Thea::LineN< N, T >

A straight line in N-dimensional space, where N is any positive (non-zero) integer and T is a field.

Definition at line 25 of file LineN.hpp.

## Member Typedef Documentation

 typedef LineN LineT
inherited

N-dimensional straight line.

Definition at line 39 of file LineN.hpp.

 typedef Vector VectorT
inherited

N-dimensional vector.

Definition at line 40 of file LineN.hpp.

## Member Function Documentation

 LineN cast ( ) const
inherited

Cast the line to a different scalar type.

Definition at line 66 of file LineN.hpp.

 VectorT closestPoint ( VectorT const & p ) const
inherited

Get the point on the line closest to a given point.

Definition at line 91 of file LineN.hpp.

 T distance ( VectorT const & p ) const
inherited

Get the distance of the line from a given point.

Definition at line 79 of file LineN.hpp.

 T distance ( LineT const & other ) const
inherited

Get the distance of this line from another line.

Definition at line 98 of file LineN.hpp.

 static LineT fromPointAndDirection ( VectorT const & point_, VectorT const & direction_, bool normalize = `true` )
staticinherited

Construct a line from a point on it, and the direction vector of the line (need not be a unit vector).

The normalize argument suppresses rescaling of the direction vector to unit length if set to false.

Definition at line 48 of file LineN.hpp.

 static LineT fromTwoPoints ( VectorT const & point1, VectorT const & point2 )
staticinherited

Construct a line from two points on it.

Definition at line 60 of file LineN.hpp.

 VectorT const& getDirection ( ) const
inherited

Get the unit direction vector of the line.

Definition at line 76 of file LineN.hpp.

 VectorT const& getPoint ( ) const
inherited

Get a point on the line.

Definition at line 73 of file LineN.hpp.

 T squaredDistance ( VectorT const & p ) const
inherited

Get the square of the distance of the line from a given point.

Definition at line 85 of file LineN.hpp.

 T squaredDistance ( LineT const & other, VectorT * this_pt = `nullptr`, VectorT * other_pt = `nullptr` ) const
inherited

Get the point on this line and the point on another line closest to each other, and return the squared distance between them.

Definition at line 107 of file LineN.hpp.

 std::string toString ( ) const
inherited

Get a textual description of the line.

Definition at line 138 of file LineN.hpp.

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