Debian Codegraph @

packages/seacas/applications/blot/bl_rotate.f

raw
1 C Copyright(C) 1999-2020, 2023 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 BL_ROTATE (NUM, NPROT, ROTMAT, ROTCEN,
9 & XN, YN, ZN, HZ, VT, PD)
10 C=======================================================================
11
12 C --*** ROTATE *** (MESH) Rotate 3D coordinates
13 C -- Written by Amy Gilkey - revised 09/09/87
14 C --
15 C --ROTATE rotates the 3D coordinates by subtracting the rotation center
16 C --and multiplying by the rotation matrix.
17 C --
18 C --Parameters:
19 C -- NUM - IN - the number of nodes to rotate
20 C -- NPROT - IN - the node numbers of the nodes to rotate
21 C -- ROTMAT - IN - the rotation matrix
22 C -- ROTCEN - IN - the center of the rotation
23 C -- XN, YN, ZN - IN - the original nodal coordinates
24 C -- HZ, VT, PD - OUT - the rotated nodal coordinates
25
26 INTEGER NPROT(NUM)
27 REAL ROTMAT(3,3), ROTCEN(3)
28 REAL XN(*), YN(*), ZN(*)
29 REAL HZ(*), VT(*), PD(*)
30
31 DO 100 IX = 1, NUM
32 INP = NPROT(IX)
33 X = XN(INP) - ROTCEN(1)
34 Y = YN(INP) - ROTCEN(2)
35 Z = ZN(INP) - ROTCEN(3)
36 HZ(INP) = X*ROTMAT(1,1) + Y*ROTMAT(2,1) + Z*ROTMAT(3,1)
37 VT(INP) = X*ROTMAT(1,2) + Y*ROTMAT(2,2) + Z*ROTMAT(3,2)
38 PD(INP) = X*ROTMAT(1,3) + Y*ROTMAT(2,3) + Z*ROTMAT(3,3)
39 100 CONTINUE
40
41 RETURN
42 END