Appendix 2 - 2D and 3D geometry

The files GEOM2D.FOR , GEOM2D.FOR , each contain a set of routines for carrying out simply geometric functions in two dimensions and three dimensions respectively.

Two-dimensional geometry

real function SIZE2 returns the modulus of a 2-vector

real function SSIZE2 returns the square of the modulus of a 2-vector

real function DOT2 returns the dot product of two 2-vectors.

subroutine SUBV2 gives the result of the subtraction of one 2-vector from another

real function DIST2 returns the distance between two points

subroutine NORM2 gives the normal to the line joining two vectors, pointing right on a line from the first vector to the second

Three-dimensional geometry

real function DIST3 returns the distance between two 3-vectors.

real function AREA returns the area of the triangle with the vertices of three 3-vectors

real function SIZE3 returns the modulus of a 3-vector

real function SSIZE3 returns the square of the modulus of a 3-vector

real function DOT3 returns the dot product of two 3-vectors

subroutine SUBV3 gives the output of the subtraction of one vector from another

subroutine NORM3 gives the normal to the triangle with three given vertices. The normal points outwards when the vertices are viewed clockwise.


Return to boundary-element-method.com