face_normal3 Function

public elemental function face_normal3(pt1, pt2, pt3, norm) result(normal)

Calculate the normal of the face defined by the 3 points.

The convention for the points numeration is the following:

 3.----.2
   \   |
    \  |
     \ |
      \|
       .1

The normal is calculated by the cross product of the side s12 for the side s13: s12 x s13. The normal is normalized if the variable norm is passed (with any value).

 type(vector) :: pt(0:3)

 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(0) = pt(1)%face_normal3(pt1=pt(1), pt2=pt(2), pt3=pt(3), norm='y')
 print "(3(F3.1,1X))", abs(pt(0)%x), abs(pt(0)%y), abs(pt(0)%z)
 type(vector) :: pt(0:3)

 pt(1) = ex
 pt(2) = ey
 pt(3) = ex - ey
 pt(0) = face_normal3(pt1=pt(1), pt2=pt(2), pt3=pt(3), norm='y')
 print "(3(F3.1,1X))", abs(pt(0)%x), abs(pt(0)%y), abs(pt(0)%z)

Arguments

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

First face point.

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

Second face point.

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

Third face point.

character(len=1), intent(in), optional :: norm

If ‘norm’ is passed as argument the normal is normalized.

Return Value type(vector)

Face normal.


Calls

proc~~face_normal3~~CallsGraph proc~face_normal3 face_normal3 proc~normalized normalized proc~face_normal3->proc~normalized

Called by

proc~~face_normal3~~CalledByGraph proc~face_normal3 face_normal3 proc~distance_to_plane distance_to_plane proc~distance_to_plane->proc~face_normal3 proc~distance_vectorial_to_plane distance_vectorial_to_plane proc~distance_vectorial_to_plane->proc~face_normal3 program~volatile_doctest~67 volatile_doctest program~volatile_doctest~67->proc~face_normal3 program~volatile_doctest~73 volatile_doctest program~volatile_doctest~73->proc~distance_to_plane program~volatile_doctest~176 volatile_doctest program~volatile_doctest~176->proc~distance_vectorial_to_plane

Contents

None