Initial revision
This commit is contained in:
14
difrac/angl.f
Normal file
14
difrac/angl.f
Normal file
@@ -0,0 +1,14 @@
|
||||
C-----------------------------------------------------------------------
|
||||
C Calculate the angle between two Cartesian vectors
|
||||
C-----------------------------------------------------------------------
|
||||
SUBROUTINE ANGL (X1,Y1,Z1,X2,Y2,Z2,ANGLE)
|
||||
SPROD = X1*X2 + Y1*Y2 + Z1*Z2
|
||||
SMOD = (X1*X1 + Y1*Y1 + Z1*Z1)*(X2*X2 + Y2*Y2 + Z2*Z2)
|
||||
COSIN = SPROD/SQRT(SMOD)
|
||||
IF (COSIN .GE. 1) COSIN = 1
|
||||
IF (COSIN .LT. -1) COSIN = -1
|
||||
ANGLE = ACOS(COSIN)
|
||||
ANGLE = ANGLE*180/3.141593
|
||||
RETURN
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user