[MAP Logo]

Materials Algorithms Project
Program Library



Subroutine MAP_UTIL_NORM

  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 normalise a three dimensional vector.

Top | Next | Prev

Specification

Language:FORTRAN
Product form:Source code

SUBROUTINE MAP_UTIL_NORM(X, Y, Z)

REAL X, Y, Z

Top | Next | Prev

Description

MAP_UTIL_NORM normalises the vector [X,Y,Z]. The subroutine calculates the square root of X2 + Y2 + Z2 and divides each component of the vector by it.

Top | Next | Prev

References

None supplied.

Top | Next | Prev

Parameters

Input parameters

X,Y,Z - reals
X,Y,Z are the components of the input vector.

Output parameters

X,Y,Z - reals
On output, X,Y,Z, are the normalised components of the vector.

Top | Next | Prev

Error Indicators

None.

Top | Next | Prev

Accuracy

No information supplied.

Top | Next | Prev

Further Comments

None.

Top | Next | Prev

Example

1. Program text

       REAL X,Y,Z
       READ (5,*) X,Y,Z
       CALL MAP_UTIL_NORM(X,Y,Z)
       WRITE (6,*) X,Y,Z
       STOP
       END

2. Program data

1.0   2.0   3.0

3. Program results

0.267261   0.534522   0.801784

Top | Next | Prev

Auxiliary Routines

None.

Top | Next | Prev

Keywords

normalise, vector

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!