8#ifndef META_OCEAN_MATH_FINITE_LINE_3_H
9#define META_OCEAN_MATH_FINITE_LINE_3_H
210 explicit inline operator bool()
const;
257 ocean_assert(index <= 1u);
325 const T dotProduct = lineOffset * pointOffset;
334 if (dotProduct >= lineOffset.
sqr())
361 point = intersectionPoint;
390 return !(*
this == right);
This class implements an finite line in 3D space.
Definition FiniteLine3.h:66
bool operator!=(const FiniteLineT3< T > &right) const
Returns whether two line are identical up to a small epsilon.
Definition FiniteLine3.h:388
T length() const
Returns the length of the finite line.
Definition FiniteLine3.h:288
VectorT3< T > midpoint() const
Returns the midpoint of the line.
Definition FiniteLine3.h:270
const VectorT3< Scalar > & point1() const
Scalar Type
Definition FiniteLine3.h:72
VectorT3< Scalar > point1_
Definition FiniteLine3.h:218
FiniteLineT3(const FiniteLineT3< U > &line)
Copies a line with different data type than T.
Definition FiniteLine3.h:235
bool intersection(const FiniteLineT3< T > &right, VectorT3< T > &point) const
Returns the intersection point of two finite lines.
Definition FiniteLine3.h:344
bool isParallel(const FiniteLineT3< T > &right) const
Returns whether two lines are parallel up to a small epsilon.
Definition FiniteLine3.h:367
bool operator==(const FiniteLineT3< T > &right) const
Returns whether two line are identical up to a small epsilon.
Definition FiniteLine3.h:381
bool isValid() const
Returns whether this line has valid parameters.
Definition FiniteLine3.h:375
VectorT3< T > nearestPoint(const VectorT3< T > &point) const
Returns the point on this line nearest to an arbitrary given point.
Definition FiniteLine3.h:318
T sqrDistance(const VectorT3< T > &point) const
Returns the square distance between the line and a given point.
Definition FiniteLine3.h:310
bool isOnLine(const VectorT3< T > &point) const
Returns whether a given point is part of the finite line.
Definition FiniteLine3.h:294
const VectorT3< T > & point(const unsigned int index) const
Returns the first or second end point of the line.
Definition FiniteLine3.h:255
const VectorT3< T > & direction() const
Returns the direction of the line: normalize(point1() - point0()).
Definition FiniteLine3.h:276
FiniteLineT3()=default
Creates a finite line with default parameters.
T sqrLength() const
Returns the squared length of the finite line.
Definition FiniteLine3.h:282
VectorT3< Scalar > direction_
Definition FiniteLine3.h:221
const VectorT3< Scalar > & point0() const
FiniteLineT3(const VectorT3< T > &point0, const VectorT3< T > &point1)
Creates a finite line defined by two end points of the line.
Definition FiniteLine3.h:225
T distance(const VectorT3< T > &point) const
Returns the distance between the line and a given point.
Definition FiniteLine3.h:302
VectorT3< Scalar > point0_
Definition FiniteLine3.h:215
This class implements an infinite line in 3D space.
Definition Line3.h:69
static T sqrt(const T value)
Returns the square root of a given value.
Definition Numeric.h:1537
static constexpr bool isEqualEps(const T value)
Returns whether a value is smaller than or equal to a small epsilon.
Definition Numeric.h:2096
This class implements a vector with three elements.
Definition Vector3.h:97
T sqr() const
Returns the square of the vector length.
Definition Vector3.h:674
unsigned int sqrDistance(const char first, const char second)
Returns the square distance between two values.
Definition base/Utilities.h:1159
std::vector< FiniteLine3 > FiniteLines3
Definition of a vector holding FiniteLine3 objects.
Definition FiniteLine3.h:55
FiniteLineT3< double > FiniteLineD3
Instantiation of the LineT3 template class using a double precision float data type.
Definition FiniteLine3.h:33
std::vector< FiniteLineT3< T > > FiniteLinesT3
Definition of a typename alias for vectors with FiniteLineT3 objects.
Definition FiniteLine3.h:48
FiniteLineT3< Scalar > FiniteLine3
Definition of the FiniteLine3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with si...
Definition FiniteLine3.h:26
FiniteLineT3< float > FiniteLineF3
Instantiation of the LineT3 template class using a single precision float data type.
Definition FiniteLine3.h:40
The namespace covering the entire Ocean framework.
Definition Accessor.h:15