Virtual Testbed
Ship dynamics simulator for extreme conditions
|
Three- and two-dimensional plane. More...
#include <plane.hh>
Public Types | |
using | scalar_type = T |
using | value_type = Vertex< T, N > |
using | reference = value_type & |
using | const_reference = const value_type & |
Public Member Functions | |
Plane (const_reference normal, const_reference origin) | |
Plane (const_reference normal) | |
Plane (const_reference a, const_reference b, const_reference c) | |
Construct plane from plane equation. More... | |
const_reference | normal () const |
A vector that is orthogonal to the plane. | |
const_reference | origin () const |
A point on the plane. | |
void | invert () |
Invert plane orientation (the direction of the normal). | |
T | operator() (const_reference point) const |
Substitute point p to the plane equation. More... | |
T | operator() () const |
Substitute nought into the plane equation to get \(d\). More... | |
value_type | project (const_reference point) const |
Project point on the plane. More... | |
value_type | project_vector (const_reference vector) const |
Project vector on the plane. More... | |
int | redundant_dimension () const |
The index of dimension that has nought basis vector. More... | |
Basis< T, N > | basis () const |
Vector basis for the coordinate system defined by the and the origin. More... | |
Coordinate_system< T, N > | coordinate_system () const |
Coordinate system defined by the and the origin. More... | |
void | clear () |
void | gnuplot (std::ostream &out) const |
template<> | |
Plane (const_reference a, const_reference b, const_reference c) | |
template<> | |
int | redundant_dimension () const |
template<> | |
vtb::geometry::Basis< T, 3 > | basis () const |
template<> | |
vtb::geometry::Coordinate_system< T, 3 > | coordinate_system () const |
Static Public Attributes | |
static constexpr const int | dimensions = N |
Three- and two-dimensional plane.
line_normal
and surface_normal
global functions.
|
explicit |
Construct plane from plane equation.
The plane is defined by equation \(ax+by+cz+d=0\), where \((a,b,c)\) is plane normal and \(d\) is a normal multiplied by any point lying on the plane.
Basis<T,N> vtb::geometry::Plane< T, N >::basis | ( | ) | const |
Vector basis for the coordinate system defined by the and the origin.
Coordinate_system<T,N> vtb::geometry::Plane< T, N >::coordinate_system | ( | ) | const |
Coordinate system defined by the and the origin.
This system can be used to project arbitrary points on the plane and then "unproject" them back. After projecting the point on the plane one of its coordinates becomes redundant. The redundant dimension is returned by method. See puncture
and restore
global functions that reduce and add dimensions to a vertex.
|
inline |
Substitute point p
to the plane equation.
p
lies behind the plane. p
lies in front of the plane. p
lies on the plane. Definition at line 87 of file plane.hh.
References vtb::geometry::Plane< T, N >::normal(), and vtb::geometry::Plane< T, N >::origin().
|
inline |
Substitute nought into the plane equation to get \(d\).
Definition at line 97 of file plane.hh.
References vtb::geometry::Plane< T, N >::normal(), and vtb::geometry::Plane< T, N >::origin().
|
inline |
Project point
on the plane.
Definition at line 105 of file plane.hh.
References vtb::geometry::Plane< T, N >::normal(), and vtb::geometry::Plane< T, N >::origin().
|
inline |
Project vector
on the plane.
Definition at line 114 of file plane.hh.
References vtb::geometry::Plane< T, N >::normal().
int vtb::geometry::Plane< T, N >::redundant_dimension | ( | ) | const |
The index of dimension that has nought basis vector.
Method still returns unit vector instead of nought for this dimension.