Debian Codegraph @

packages/seacas/applications/blot/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 *** (MESH) 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 IF (XYZ .EQ. 'X') THEN
29 N1 = 2
30 N2 = 3
31 N3 = 1
32 ELSE IF (XYZ .EQ. 'Y') THEN
33 N1 = 3
34 N2 = 1
35 N3 = 2
36 ELSE IF (XYZ .EQ. 'Z') THEN
37 N1 = 1
38 N2 = 2
39 N3 = 3
40 END IF
41
42 COSANG = COS (ANG)
43 SINANG = SIN (ANG)
44 BY(N1,N1) = COSANG
45 BY(N2,N1) = -SINANG
46 BY(N1,N3) = 0.0
47 BY(N1,N2) = SINANG
48 BY(N2,N2) = COSANG
49 BY(N2,N3) = 0.0
50 BY(N3,N1) = 0.0
51 BY(N3,N2) = 0.0
52 BY(N3,N3) = 1.0
53
54 DO 110 I = 1, 3
55 DO 100 J = 1, 3
56 RES(I,J) = ROTMAT(I,1)*BY(1,J) + ROTMAT(I,2)*BY(2,J)
57 & + ROTMAT(I,3)*BY(3,J)
58 100 CONTINUE
59 110 CONTINUE
60
61 CALL CPYREA (3*3, RES, ROTMAT)
62
63 RETURN
64 END