This class implements an finite line in 3D space.
More...
|
typedef T | Type |
| Definition of the used data type. More...
|
|
template<typename T>
class Ocean::FiniteLineT3< T >
This class implements an finite line in 3D space.
The finite line object is invalid if both end points of the line object are identical.
- Template Parameters
-
T | Data type used to represent lines |
- See also
- FiniteLine3, FiniteLineF3, FiniteLineD3, Line3, Line3
◆ Type
Definition of the used data type.
◆ FiniteLineT3() [1/3]
Creates a finite line with default parameters.
◆ FiniteLineT3() [2/3]
Creates a finite line defined by two end points of the line.
- Parameters
-
point0 | First end point of the line |
point1 | Second end point of the line, must be different from point0 to create a valid line, otherwise the line is invalid |
◆ FiniteLineT3() [3/3]
template<typename T >
template<typename U >
Copies a line with different data type than T.
- Parameters
-
- Template Parameters
-
U | The data type of the second line |
◆ direction()
Returns the direction of the line: normalize(point1() - point0())
- Returns
- Direction vector with unit length, a zero vector if the line is invalid
- See also
- isValid().
◆ distance()
Returns the distance between the line and a given point.
This function needs a unit vector as direction!
- Parameters
-
point | Point to return the distance for |
- Returns
- Distance between point and line
◆ intersection()
Returns the intersection pointer of two finite lines.
- Parameters
-
right | Right line for intersection calculation |
point | Resulting intersection pointer |
- Returns
- True, if both lines have a common intersection point
◆ isOnLine()
Returns whether a given point is part of the finite line.
- Parameters
-
- Returns
- True, if so
◆ isParallel()
Returns whether two lines are parallel up to a small epsilon.
- Parameters
-
- Returns
- True, if so
◆ isValid()
Returns whether this line has valid parameters.
- Returns
- True, if so
◆ midpoint()
Returns the midpoint of the line.
- Returns
- Midpoint point of the line
◆ nearestPoint()
Returns the point on this line nearest to an arbitrary given point.
This function needs a unit vector as direction!
- Parameters
-
point | Arbitrary point outside the line |
- Returns
- Nearest point on the line
◆ operator bool()
Returns whether this line is valid.
- Returns
- True, if so
◆ operator!=()
Returns whether two line are identical up to a small epsilon.
- Parameters
-
- Returns
- True, if so
◆ operator==()
Returns whether two line are identical up to a small epsilon.
Two finite lines are identical if both lines have the same endpoint (independent of the order of the end points).
- Parameters
-
- Returns
- True, if so
◆ point()
Returns the first or second end point of the line.
- Parameters
-
index | The index of the point to be returned, with range [0, 1] |
- Returns
- First or second end point of the line
◆ point0()
Returns the first end point of the line.
- Returns
- First end point of the line
◆ point1()
Returns the second end point of the line.
- Returns
- Second end point of the line
◆ sqrDistance()
Returns the square distance between the line and a given point.
- Parameters
-
point | Point to return the distance for |
- Returns
- Square distance between point and line
◆ lineDirection
Direction of the line with unit length, if the object holds valid parameters.
◆ linePoint0
First end point of the line.
◆ linePoint1
Second end point of the line.
The documentation for this class was generated from the following file: