plane Interface

public interface plane

Contents


Module Procedures

private pure function plane_from_3pts(pt1, pt2, pt3) result(rst)

Constructs a plane from 3 points. The 3 points must not be colinear.

Arguments

Type IntentOptional 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.

Return Value type(plane)

The resulting plane.

private pure function plane_from_point_and_normal(pt, nrm) result(rst)

Constructs a plane from a point which lies on the plane, and a unit vector normal to the plane.

Arguments

Type IntentOptional 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.

Return Value type(plane)

The resulting plane.

private pure function plane_from_many_points(pts) result(rst)

Constructs the plane that best fits a cloud of points in a least-squares sense.

Arguments

Type IntentOptional 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.

Return Value type(plane)

The resulting plane.