Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
12aa9568
Commit
12aa9568
authored
Jun 11, 2018
by
Lynn Garren
Browse files
fix a shadowing problem
parent
24f15697
Changes
1
Hide whitespace changes
Inline
Side-by-side
Vector/src/RotationA.cc
View file @
12aa9568
...
...
@@ -89,31 +89,31 @@ Hep3Vector HepRotation::axis () const {
double
cosdelta
=
(
rxx
+
ryy
+
rzz
-
1.0
)
/
2.0
;
if
(
cosdelta
>
0.0
)
return
Hep3Vector
(
0
,
0
,
1
);
// angle = 0, any axis is good
double
xx
=
(
rxx
+
1
)
/
2
;
double
yy
=
(
ryy
+
1
)
/
2
;
double
zz
=
(
rzz
+
1
)
/
2
;
double
xy
=
(
rxy
+
ryx
)
/
4
;
double
xz
=
(
rxz
+
rzx
)
/
4
;
double
yz
=
(
ryz
+
rzy
)
/
4
;
double
xx
t
=
(
rxx
+
1
)
/
2
;
double
yy
t
=
(
ryy
+
1
)
/
2
;
double
zz
t
=
(
rzz
+
1
)
/
2
;
double
xy
t
=
(
rxy
+
ryx
)
/
4
;
double
xz
t
=
(
rxz
+
rzx
)
/
4
;
double
yz
t
=
(
ryz
+
rzy
)
/
4
;
double
x
,
y
,
z
;
if
(
xx
>
ryy
&&
xx
>
rzz
)
{
x
=
std
::
sqrt
(
xx
);
if
(
xx
t
>
ryy
&&
xx
t
>
rzz
)
{
x
=
std
::
sqrt
(
xx
t
);
if
(
rzy
-
ryz
<
0
)
x
=
-
x
;
y
=
xy
/
x
;
z
=
xz
/
x
;
y
=
xy
t
/
x
;
z
=
xz
t
/
x
;
return
Hep3Vector
(
x
,
y
,
z
).
unit
();
}
else
if
(
yy
>
zz
)
{
y
=
std
::
sqrt
(
yy
);
}
else
if
(
yy
t
>
zz
t
)
{
y
=
std
::
sqrt
(
yy
t
);
if
(
rxz
-
rzx
<
0
)
y
=
-
y
;
x
=
xy
/
y
;
z
=
yz
/
y
;
x
=
xy
t
/
y
;
z
=
yz
t
/
y
;
return
Hep3Vector
(
x
,
y
,
z
).
unit
();
}
else
{
z
=
std
::
sqrt
(
zz
);
z
=
std
::
sqrt
(
zz
t
);
if
(
ryx
-
rxy
<
0
)
z
=
-
z
;
x
=
xz
/
z
;
y
=
yz
/
z
;
x
=
xz
t
/
z
;
y
=
yz
t
/
z
;
return
Hep3Vector
(
x
,
y
,
z
).
unit
();
}
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment