[MAP Logo]

Materials Algorithms Project
Program Library



Subroutine MAP_CRYSTAL_ANGLEE

  1. Provenance of code.
  2. Purpose of code.
  3. Specification.
  4. Description of subroutine's operation.
  5. References.
  6. Parameter descriptions.
  7. Error indicators.
  8. Accuracy estimate.
  9. Any additional information.
  10. Example of code
  11. Auxiliary subroutines required.
  12. Keywords.
  13. Download source code.
  14. Links.

Provenance of Source Code

H.K.D.H. Bhadeshia,
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge, U.K.

Top | Next

Purpose

To find the angle between two vectors.

Top | Next | Prev

Specification

Language:FORTRAN
Product form:Source code

SUBROUTINE MAP_CRYSTAL_ANGLEE(F, G, H, K, L, JR1, HH, KK, LL, JR2, ANG, ADEG, PI)

REAL F(9), G(9), H, K, L, HH, KK, LL, ANG, ADEG, PI

INTEGER JR1, JR2

Top | Next | Prev

Description

The vectors may be defined by components in real or reciprocal space. The metric tensor F converts components from reciprocal to real space. The metric tensor G converts components from real to reciprocal space.

In order to calculate the angle, it is necessary for one vector to be defined in real space, and the other in reciprocal space. The magnitude of each vector is calculated, and the scalar product of the two vectors is used to compute the angle.

Top | Next | Prev

References

  1. H.K.D.H. Bhadeshia, Worked Examples in the Geometry of Crystals, Institute of Materials, London, 1987.

Top | Next | Prev

Parameters

Input parameters

F - real array of dimension 9
F is a metric tensor used to convert components from reciprocal to real space.

G - real array of dimension 9
G is a metric tensor used to convert the components from real to reciprocal space.

H, K, L - reals
H, K, L are the components of the first vector [H,K,L].

JR1 - integer
JR1 is 0 if the vector [H,K,L] is in real space coordinates, 1 if it is in reciprocal space.

HH, KK, LL - reals
HH, KK, LL are the components on the second vector [HH,KK,LL].

JR2 - integer
JR2 is 0 if the vector [HH,KK,LL] is in real space coordinates, 1 if it is in reciprocal space.

PI - real
PI is pi.

Output parameters

ANG - real
ANG is the angle in radians.

ADEG - real
ADEG is the angle in degrees.

Top | Next | Prev

Error Indicators

None.

Top | Next | Prev

Accuracy

Works for any crystal system.

Top | Next | Prev

Further Comments

None.

Top | Next | Prev

Example

1. Program text

       REAL F(9), G(9), H, K, L, HH, KK, LL, ANG, ADEG, AP, CP, PI
       INTEGER JR1, JR2
       INCLUDE 'map_constants_pi.f'
       READ (5,*) AP, CP
       CALL MAP_CRYSTAL_TENSOR2(F, G, AP, CP)
       READ (5,*) H, K, L, JR1
       READ (5,*) HH, KK, LL, JR2
       CALL MAP_CRYSTAL_ANGLEE(F, G, H, K, L, JR1, HH, KK, LL, JR2, ANG, ADEG, PI)
       WRITE (6,*) ANG, ADEG
       STOP
       END

2. Program data

1.0   1.0
0.0   1.0   1.0   0
1.0   0.0   1.0   1

3. Program results

0.500000   120.000

Top | Next | Prev

Auxiliary Routines

MAP_UTIL_TRANS
MAP_UTIL_MAG

Top | Next | Prev

Keywords

angle

Top | Next | Prev

Download

Download source code

Top | Prev


MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.

MAP Website administration / map@msm.cam.ac.uk

Top | Index | MAP Homepage Valid HTML 3.2!