Line segment in two dimensions.
More...
#include <JSegment3D.hh>
Line segment in two dimensions.
Definition at line 33 of file JSegment3D.hh.
◆ JSegment3D() [1/2]
JGEOMETRY3D::JSegment3D::JSegment3D |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 40 of file JSegment3D.hh.
std::pair< JPosition3D, JPosition3D > JSegment3D_t
Type definition of line segment in two dimensions.
◆ JSegment3D() [2/2]
Constructor.
- Parameters
-
A | start position |
B | end position |
Definition at line 51 of file JSegment3D.hh.
◆ getLengthSquared()
double JGEOMETRY3D::JSegment3D::getLengthSquared |
( |
| ) |
const |
|
inline |
Get length squared.
- Returns
- square of length
Definition at line 62 of file JSegment3D.hh.
Data structure for vector in three dimensions.
double getLengthSquared() const
Get length squared.
◆ getLength()
double JGEOMETRY3D::JSegment3D::getLength |
( |
| ) |
const |
|
inline |
Get length.
- Returns
- length
Definition at line 73 of file JSegment3D.hh.
double getLengthSquared() const
Get length squared.
◆ getDistanceSquared()
double JGEOMETRY3D::JSegment3D::getDistanceSquared |
( |
const JVector3D & |
point, |
|
|
const double |
precision = 1.0e-8 |
|
) |
| const |
|
inline |
Get squared of distance to point.
- Parameters
-
point | point |
precision | precision |
- Returns
- square of distance
Definition at line 86 of file JSegment3D.hh.
90 const double gp = D.getLengthSquared();
96 double u = D.getDot(U);
108 return D.getLengthSquared();
112 return this->first.getDistanceSquared(point);
◆ getDistance()
double JGEOMETRY3D::JSegment3D::getDistance |
( |
const JVector3D & |
point | ) |
const |
|
inline |
Get distance to point.
- Parameters
-
- Returns
- distance
Definition at line 123 of file JSegment3D.hh.
double getDistanceSquared(const JVector3D &point, const double precision=1.0e-8) const
Get squared of distance to point.
◆ getDot()
double JGEOMETRY3D::JSegment3D::getDot |
( |
const JSegment3D & |
segment | ) |
const |
|
inline |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 135 of file JSegment3D.hh.
137 return JVector3D(this->second - this->first).
getDot(segment.second - segment.first);
double getDot(const JVector3D &vector) const
Get dot product.
◆ operator>>
Read segment from input.
- Parameters
-
- Returns
- reader
Definition at line 148 of file JSegment3D.hh.
151 in >> segment.second;
◆ operator<<
Write segment to output.
- Parameters
-
- Returns
- writer
Definition at line 164 of file JSegment3D.hh.
166 out << segment.first;
167 out << segment.second;
The documentation for this class was generated from the following file: