OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
euler_mrot.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23C This function computes a 3d rotation matrix.
24C The rotation is about the axis <rx,ry,rz> .
25C The rotation angle [sqrt(rx**2+ry**2+rz**2)] is specified in degrees.
26C These rotation is counter-clockwise looking from the positive direction.
27!||====================================================================
28!|| euler_mrot ../starter/source/model/submodel/euler_mrot.F
29!||--- called by ------------------------------------------------------
30!|| lectrans ../starter/source/model/transformation/lectrans.F
31!|| lectranssub ../starter/source/model/submodel/lectranssub.F
32!||====================================================================
33 SUBROUTINE euler_mrot (RX,RY,RZ,ROT)
34C-----------------------------------------------
35C I m p l i c i t T y p e s
36C-----------------------------------------------
37#include "implicit_f.inc"
38C-----------------------------------------------
39C D u m m y A r g u m e n t s
40C-----------------------------------------------
41C REAL
43 . rx,ry,rz, rot(9)
44C-----------------------------------------------
45C L o c a l V a r i a b l e s
46C-----------------------------------------------
47C REAL
49 . rx2, ry2, rz2, r2, r, c, cm1, s, sx, sy, sz, cz,
50 . e11, e22, e33, e12, e13, e31, e32, e21, e23
51C=======================================================================
52 rx2 = rx*rx
53 ry2 = ry*ry
54 rz2 = rz*rz
55 r2 = max(em20,rx2+ry2+rz2)
56 r = sqrt(r2)
57C
58 c = cos(r)
59 s = sin(r)
60 cm1 = one - c
61C
62 rx = rx / r
63 ry = ry / r
64 rz = rz / r
65 rx2 = rx2 / r2
66 ry2 = ry2 / r2
67 rz2 = rz2 / r2
68C
69 sx = s*rx
70 sy = s*ry
71 sz = s*rz
72 cz = rz*cm1
73C-----
74 e11 = rx2*cm1 + c
75 e22 = ry2*cm1 + c
76 e33 = rz2*cm1 + c
77C
78 e12 = rx*ry*cm1
79 e21 = e12 - sz
80 e12 = e12 + sz
81C
82 e13 = rx*cz
83 e31 = e13 + sy
84 e13 = e13 - sy
85C
86 e23 = ry *cz
87 e32 = e23 - sx
88 e23 = e23 + sx
89C-----
90 rot(1) = e11
91 rot(2) = e12
92 rot(3) = e13
93 rot(4) = e21
94 rot(5) = e22
95 rot(6) = e23
96 rot(7) = e31
97 rot(8) = e32
98 rot(9) = e33
99C---
100 RETURN
101 END
#define my_real
Definition cppsort.cpp:32
subroutine euler_mrot(rx, ry, rz, rot)
Definition euler_mrot.F:34
#define max(a, b)
Definition macros.h:21