Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Mojtaba Abdolkhani
ogs
Commits
341da31d
Commit
341da31d
authored
8 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
add sgn(), to_radians() in MathTools.h
parent
4bfd1fd4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MathLib/MathTools.h
+11
-0
11 additions, 0 deletions
MathLib/MathTools.h
with
11 additions
and
0 deletions
MathLib/MathTools.h
+
11
−
0
View file @
341da31d
...
...
@@ -11,6 +11,7 @@
#ifndef MATHTOOLS_H_
#define MATHTOOLS_H_
#include
<cmath>
#include
<cstddef>
#ifdef _OPENMP
...
...
@@ -111,6 +112,16 @@ double sqrDist(const double* p0, const double* p1)
*/
double
getAngle
(
const
double
p0
[
3
],
const
double
p1
[
3
],
const
double
p2
[
3
]);
/// sign function
template
<
typename
T
>
int
sgn
(
T
val
)
{
return
(
T
(
0
)
<
val
)
-
(
val
<
T
(
0
));
}
/// converts the given degrees to radians
inline
double
to_radians
(
double
degrees
)
{
return
degrees
*
M_PI
/
180.
;
}
}
// namespace
#endif
/* MATHTOOLS_H_ */
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