Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
e1f3b216
Commit
e1f3b216
authored
8 years ago
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Inlined DihedralAngle and ensured Real-ops used for increased performance.
parent
c7c58a09
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/geom/src/vecmat3_op.cc
+0
-14
0 additions, 14 deletions
modules/geom/src/vecmat3_op.cc
modules/geom/src/vecmat3_op.hh
+10
-3
10 additions, 3 deletions
modules/geom/src/vecmat3_op.hh
with
10 additions
and
17 deletions
modules/geom/src/vecmat3_op.cc
+
0
−
14
View file @
e1f3b216
...
@@ -178,20 +178,6 @@ Mat3 AxisRotation(const Vec3& axis, Real angle)
...
@@ -178,20 +178,6 @@ Mat3 AxisRotation(const Vec3& axis, Real angle)
xy
-
ca
*
xy
+
sa
*
z
,
yy
+
ca
-
ca
*
yy
,
yz
-
ca
*
yz
-
sa
*
x
,
xy
-
ca
*
xy
+
sa
*
z
,
yy
+
ca
-
ca
*
yy
,
yz
-
ca
*
yz
-
sa
*
x
,
xz
-
ca
*
xz
-
sa
*
y
,
yz
-
ca
*
yz
+
sa
*
x
,
zz
+
ca
-
ca
*
zz
);
xz
-
ca
*
xz
-
sa
*
y
,
yz
-
ca
*
yz
+
sa
*
x
,
zz
+
ca
-
ca
*
zz
);
}
}
Real
DihedralAngle
(
const
Vec3
&
p1
,
const
Vec3
&
p2
,
const
Vec3
&
p3
,
const
Vec3
&
p4
)
{
Vec3
r1
=
p2
-
p1
;
Vec3
r2
=
p3
-
p2
;
Vec3
r3
=
p4
-
p3
;
Vec3
r12cross
=
Cross
(
r1
,
r2
);
Vec3
r23cross
=
Cross
(
r2
,
r3
);
return
atan2
(
Dot
(
r1
*
Length
(
r2
),
r23cross
),
Dot
(
r12cross
,
r23cross
));
}
Real
MinDistance
(
const
Vec3List
&
l1
,
const
Vec3List
&
l2
)
Real
MinDistance
(
const
Vec3List
&
l1
,
const
Vec3List
&
l2
)
{
{
...
...
This diff is collapsed.
Click to expand it.
modules/geom/src/vecmat3_op.hh
+
10
−
3
View file @
e1f3b216
...
@@ -166,9 +166,16 @@ Mat3 DLLEXPORT_OST_GEOM AxisRotation(const Vec3& axis, Real angle);
...
@@ -166,9 +166,16 @@ Mat3 DLLEXPORT_OST_GEOM AxisRotation(const Vec3& axis, Real angle);
/// The returned vector is of length 1
/// The returned vector is of length 1
Vec3
DLLEXPORT_OST_GEOM
OrthogonalVector
(
const
Vec3
&
axis
);
Vec3
DLLEXPORT_OST_GEOM
OrthogonalVector
(
const
Vec3
&
axis
);
/// \brief Get dihedral angle for p1-p2-p3-p4
Real
DLLEXPORT_OST_GEOM
DihedralAngle
(
const
Vec3
&
p1
,
const
Vec3
&
p2
,
inline
Real
DihedralAngle
(
const
Vec3
&
p1
,
const
Vec3
&
p2
,
const
Vec3
&
p3
,
const
Vec3
&
p4
);
const
Vec3
&
p3
,
const
Vec3
&
p4
)
{
const
Vec3
r1
=
p2
-
p1
;
const
Vec3
r2
=
p3
-
p2
;
const
Vec3
r3
=
p4
-
p3
;
const
Vec3
r12cross
=
Cross
(
r1
,
r2
);
const
Vec3
r23cross
=
Cross
(
r2
,
r3
);
return
std
::
atan2
(
Dot
(
r1
*
Length
(
r2
),
r23cross
),
Dot
(
r12cross
,
r23cross
));
}
//! returns std::min of each component
//! returns std::min of each component
inline
Vec3
Min
(
const
Vec3
&
v1
,
const
Vec3
&
v2
)
inline
Vec3
Min
(
const
Vec3
&
v1
,
const
Vec3
&
v2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment