Guide to the mathematical background: Vector Arithmetic and Geometry
The files GEOM2D.FOR , GEOM3D.FOR , each contain a set of routines for carrying out simply geometric functions in two dimensions and three dimensions respectively.