Debian Codegraph @

packages/seacas/applications/grepos/gp_rotxyz.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE ROTXYZ (XYZ, ANG, ROTMAT)
9 C=======================================================================
10
11 C --*** ROTXYZ *** (GEN3D) Multiply rotation matrix by XYZ rotation
12 C -- Written by Amy Gilkey - revised 05/23/86
13 C --
14 C --ROTXYZ multiplies the current rotation matrix by the given X or Y
15 C --or Z axis rotation. Thus the XYZ axes are in viewing space, not
16 C --object space.
17 C --
18 C --Parameters:
19 C -- XYZ - IN - the axis of rotation (X,Y,Z)
20 C -- ANG - IN - the angle of rotation (in radians)
21 C -- ROTMAT - IN/OUT - the rotation matrix
22
23 CHARACTER XYZ
24 REAL ROTMAT(3,3)
25
26 REAL BY(3,3), RES(3,3)
27
28 n1 = 0
29 n2 = 0
30 n3 = 0
31
32 IF (XYZ .EQ. 'X') THEN
33 N1 = 2
34 N2 = 3
35 N3 = 1
36 ELSE IF (XYZ .EQ. 'Y') THEN
37 N1 = 3
38 N2 = 1
39 N3 = 2
40 ELSE IF (XYZ .EQ. 'Z') THEN
41 N1 = 1
42 N2 = 2
43 N3 = 3
44 END IF
45
46 COSANG = COS (ANG)
47 SINANG = SIN (ANG)
48 BY(N1,N1) = COSANG
49 BY(N2,N1) = -SINANG
50 BY(N1,N3) = 0.0
51 BY(N1,N2) = SINANG
52 BY(N2,N2) = COSANG
53 BY(N2,N3) = 0.0
54 BY(N3,N1) = 0.0
55 BY(N3,N2) = 0.0
56 BY(N3,N3) = 1.0
57
58 DO 20 I = 1, 3
59 DO 10 J = 1, 3
60 RES(I,J) = ROTMAT(I,1)*BY(1,J) + ROTMAT(I,2)*BY(2,J)
61 & + ROTMAT(I,3)*BY(3,J)
62 10 CONTINUE
63 20 CONTINUE
64
65 CALL CPYREA (3*3, RES, ROTMAT)
66
67 RETURN
68 END