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
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
Dmitri Naumov
ogs
Commits
99a7d349
Commit
99a7d349
authored
9 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MaL] Impl. of sqrDist2d.
parent
e8ef45d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MathLib/Point3d.h
+8
-0
8 additions, 0 deletions
MathLib/Point3d.h
with
8 additions
and
0 deletions
MathLib/Point3d.h
+
8
−
0
View file @
99a7d349
...
...
@@ -50,6 +50,14 @@ double sqrDist(MathLib::Point3d const& p0, MathLib::Point3d const& p1)
return
MathLib
::
scalarProduct
<
double
,
3
>
(
v
,
v
);
}
/// Computes the squared distance between the orthogonal projection of the two
/// points \c p0 and \c p1 onto the \f$xy\f$-plane.
inline
double
sqrDist2d
(
MathLib
::
Point3d
const
&
p0
,
MathLib
::
Point3d
const
&
p1
)
{
return
(
p0
[
0
]
-
p1
[
0
])
*
(
p0
[
0
]
-
p1
[
0
])
+
(
p0
[
1
]
-
p1
[
1
])
*
(
p0
[
1
]
-
p1
[
1
]);
}
}
// end namespace MathLib
#endif
/* POINT3D_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