Assigns a plane to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plane), | intent(out) | :: | x |
The resulting plane. |
||
| type(plane), | intent(in) | :: | y |
The source plane |
Assigns a line to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(line), | intent(out) | :: | x |
The resulting line. |
||
| type(line), | intent(in) | :: | y |
The source line |
Assigns a plucker_line to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plucker_line), | intent(out) | :: | x |
The resulting plucker_line. |
||
| type(plucker_line), | intent(in) | :: | y |
The source plucker_line. |
Assigns a line to a plucker_line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plucker_line), | intent(out) | :: | x |
The resulting plucker_line. |
||
| type(line), | intent(in) | :: | y |
The source line. |
Tests to see if two vectors are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The first vector. |
|
| real(kind=real64), | intent(in), | dimension(size(x)) | :: | y |
The second vector. |
|
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the vectors are parallel; else, false.
Tests to see if two lines are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(line), | intent(in) | :: | x |
The first line. |
||
| class(line), | intent(in) | :: | y |
The second line. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the lines are parallel; else, false.
Tests to see if two planes are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plane), | intent(in) | :: | x |
The first plane. |
||
| class(plane), | intent(in) | :: | y |
The second plane. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the planes are parallel; else, false.
Constructs a line from two points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt1(3) |
The first point. This point will act as the initial point along the line such that in the equation of the line . |
||
| real(kind=real64), | intent(in) | :: | pt2(3) |
The second point. |
The resulting line.
Constructs a line from the intersection of two planes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plane), | intent(in) | :: | p1 |
The first plane. |
||
| class(plane), | intent(in) | :: | p2 |
The second plane. |
The resulting line. NaN's are returned in the event that the two planes are parallel.
Constructs the line that best fits the supplied set of points in a least-squares sense.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | pts |
An N-by-3 matrix where N is at least 2, but typically much larger. |
The resulting line.
Overloads the matmul routine to allow for multiplication of the Plücker line coordinate vector with a matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | x |
The N-by-6 matrix. |
|
| type(plucker_line), | intent(in) | :: | y |
The plucker_line object. |
The resulting N-element array.
Constructs a plane from 3 points. The 3 points must not be colinear.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt1(3) |
The first point. |
||
| real(kind=real64), | intent(in) | :: | pt2(3) |
The second point. |
||
| real(kind=real64), | intent(in) | :: | pt3(3) |
The third point. |
The resulting plane.
Constructs a plane from a point which lies on the plane, and a unit vector normal to the plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point that lies on the plane. |
||
| real(kind=real64), | intent(in) | :: | nrm(3) |
The normal unit vector. |
The resulting plane.
Constructs the plane that best fits a cloud of points in a least-squares sense.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | pts |
The N-by-3 matrix containing the N points to fit. N must be at least 3, but is typically much larger. |
The resulting plane.
Constructs a new plucker_line from two points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt1(3) |
The first point. |
||
| real(kind=real64), | intent(in) | :: | pt2(3) |
The second point. |
The resulting line.
Constructs a new plucker_line from a line object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(line), | intent(in) | :: | ln |
The line. |
The equivalent plucker_line.
Constructs a new plucker_line from the intersection of two planes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plane), | intent(in) | :: | p1 |
The first plane. |
||
| class(plane), | intent(in) | :: | p2 |
The second plane. |
The resulting line. NaN's are returned in the event that the two planes are parallel.
Constructs a new plucker_line from the supplied array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(6) |
A 6-element array containing the Plücker coordinates. |
||
| logical, | intent(in), | optional | :: | nrm |
An optional input that specifies if the first three coordinates (the unit vector) should be normalized (true), or left as-is (false). The default is true such that the vector is normalized. |
The resulting line.
Defines the parametric form of a line .
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | r0(3) |
The coordinates of the initial point . |
|||
| real(kind=real64), | public | :: | v(3) |
The vector defining the orientation of the line. |
| private pure function line_from_2pts (pt1, pt2) | Constructs a line from two points. |
| private pure function line_from_2_planes (p1, p2) | Constructs a line from the intersection of two planes. |
| private pure function line_from_many_points (pts) | Constructs the line that best fits the supplied set of points in a least-squares sense. |
| procedure , public :: evaluate => line_eval Function |
Defines a plane as .
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | a |
The x-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | b |
The y-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | c |
The z-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | d |
The offset from the origin. |
| private pure function plane_from_3pts (pt1, pt2, pt3) | Constructs a plane from 3 points. The 3 points must not be colinear. |
| private pure function plane_from_point_and_normal (pt, nrm) | Constructs a plane from a point which lies on the plane, and a unit vector normal to the plane. |
| private pure function plane_from_many_points (pts) | Constructs the plane that best fits a cloud of points in a least-squares sense. |
| procedure , public :: flip_normal => plane_flip_normal Subroutine |
Defines a line in 3D Euclidean space using Plücker coordinates.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | v(6) |
The 6-element array containing the Plücker coordinates. The first 3 elements contain the unit vector and the last 3 elements contain the moment vector. |
| private pure function pl_from_2pts (pt1, pt2) | Constructs a new plucker_line from two points. |
| private pure function pl_from_line (ln) | Constructs a new plucker_line from a line object. |
| private pure function pl_from_2_planes (p1, p2) | Constructs a new plucker_line from the intersection of two planes. |
| private pure function pl_from_array (x, nrm) | Constructs a new plucker_line from the supplied array. |
| procedure , public :: m => pl_m Function | |
| procedure , public :: to_array => pl_to_array Function | |
| procedure , public :: u => pl_u Function |
Tests to see if a point lies on a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing. The default tolerance is 10x machine epsilon. |
Returns true if the point lies on the line; else, false.
Tests to see if a point lies on a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing. The default tolerance is 10x machine epsilon. |
Returns true if the point lies on the plane; else, false.
Returns the common normal line between two lines pointing from ln1 to ln2. In the event that the two lines are parallel within the specified tolerance, there exist an infinite number of common normals; therefore, a line will be chosen that runs from ln1 to ln2 with the point at t = 0 coincident with the point at t = 0 on ln1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(line), | intent(in) | :: | ln1 |
The first line. |
||
| class(line), | intent(in) | :: | ln2 |
The second line. |
The common normal line. The distance along this line between t = 0 and t = 1 defines the length of the common normal connecting ln1 to ln2. In the event that ln1 and ln2 intersect, the length of this line is zero.
Constructs a new line from a point (defines the point where t = 0) and a direction vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point at which t = 0 on the line. |
||
| real(kind=real64), | intent(in) | :: | x(3) |
The direction vector defining the orientation of the line. |
||
| logical, | intent(in), | optional | :: | nx |
An optional parameter that defines if x should be normalized to a unit vector (true), or left as-is (false). The default is true such that x is normalized to a unit vector. |
The resulting line.
Gets the line parameter for the point on the line nearest the specified point.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
The line parameteric variable defining the location of the point nearest along the line.
Returns the normal vector of a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plane), | intent(in) | :: | pln |
The plane. |
The normal vector.
Projects a point onto a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane onto which to project the point. |
The projected point.
Computes the shortest distance between a point and a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
The shortest distance between the point and line.
Computes the shortest distance between a point and a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane. |
The shortest distance between the point and plane.
Projects a vector onto a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(3) |
The vector to project. |
||
| class(plane), | intent(in) | :: | pln |
The plane onto which to project the vector. |
The projected vector.
Tests to see if two lines intersect.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(line), | intent(in) | :: | ln1 |
The first line. |
||
| class(line), | intent(in) | :: | ln2 |
The second line. |
||
| logical, | intent(out) | :: | intersect |
True if the two lines intersect within the specified tolerance; else, false if they do not intersect. |
||
| real(kind=real64), | intent(out), | optional | :: | t1 |
The parametric value associate with ln1 defining the intersection point. |
|
| real(kind=real64), | intent(out), | optional | :: | t2 |
The parametric value associate with ln2 defining the intersection point. |
|
| real(kind=real64), | intent(in), | optional | :: | tol |
The intersection tolerance. If not supplied, the default value is 10x machine epsilon. |