next up previous index
Next: F121 Vector Algebra Up: CERNLIB Previous: F117 Vector Product

F118 Rotating a 3-Vector

Routine ID: F118
Author(s): CERN TC DivisionLibrary: KERNLIB
Submitter: C. LetertreSubmitted: 01.09.1969
Language: FortranRevised:

Subroutine subprogram ROT rotates a 3-vector (a1,a2,a3)

by a given angle θ around the z-axis.

Structure:

SUBROUTINE subprogram
User Entry Names: ROT
COMMON Block Names and Lengths: /SLATE/ 40

Usage:

    CALL ROT(A,TH,B)
A
( REAL) One-dimensional array of length 3, containing (a1,a2,a3) .
TH
( REAL) Angle θ given in radians.
B
( REAL) One-dimensional array of length 3. On exit, B contains the components (b1,b2,b3) of the rotated vector, i.e.
b1=a1cosθ-a2sinθ

b2=a1sinθ+a2cosθ

b3=a3 .
B may overlap A.

F121


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995