projection_onto_plane Function

public elemental function projection_onto_plane(self, pt1, pt2, pt3) result(projection)

Calculate the projection of point onto plane defined by 3 points.

The convention for the points numeration is the following:

 1.----.2
   \   |
    \ *---------> . self
     \ |
      \|
       .3
 type(vector) :: pt(0:3)

 pt(0) = 1 * ex + 2 * ey + 5.3 * ez
 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(0) = pt(0)%projection_onto_plane(pt1=pt(1), pt2=pt(2), pt3=pt(3))
 print "(3(F3.1,1X))", pt(0)%x, pt(0)%y, pt(0)%z
 type(vector) :: pt(0:3)

 pt(0) = 1 * ex + 2 * ey + 5.3 * ez
 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(0) = projection_onto_plane(pt(0), pt1=pt(1), pt2=pt(2), pt3=pt(3))
 print "(3(F3.1,1X))", pt(0)%x, pt(0)%y, pt(0)%z

Arguments

TypeIntentOptionalAttributesName
class(vector), intent(in) :: self

The point from which computing the distance.

type(vector), intent(in) :: pt1

First plane point.

type(vector), intent(in) :: pt2

Second plane point.

type(vector), intent(in) :: pt3

Third plane point.

Return Value type(vector)

Point projection.


Called by

proc~~projection_onto_plane~~CalledByGraph proc~projection_onto_plane projection_onto_plane program~volatile_doctest volatile_doctest program~volatile_doctest->proc~projection_onto_plane

Contents

None