Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VTK Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
VTK
VTK Examples
Merge requests
!88
Modernising the code, improving images
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Modernising the code, improving images
Modernise_SimpleOperations
into
master
Overview
0
Commits
1
Pipelines
0
Changes
18
Merged
Andrew Maclean
requested to merge
Modernise_SimpleOperations
into
master
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
18
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
4f4682f5
1 commit,
4 years ago
18 files
+
120
−
113
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
18
Search (e.g. *.vue) (Ctrl+P)
src/Cxx/SimpleOperations/DistanceBetweenPoints.cxx
+
5
−
5
Options
#include
<vtkMath.h>
int
main
(
int
,
char
*
[])
int
main
(
int
,
char
*
[])
{
// Create two points.
double
p0
[
3
]
=
{
0.0
,
0.0
,
0.0
};
double
p1
[
3
]
=
{
1.0
,
1.0
,
1.0
};
// Find the squared distance between the points.
double
squaredDistance
=
vtkMath
::
Distance2BetweenPoints
(
p0
,
p1
);
// Take the square root to get the Euclidean distance between the points.
double
distance
=
sqrt
(
squaredDistance
);
double
distance
=
std
::
sqrt
(
squaredDistance
);
// Output the results.
std
::
cout
<<
"SquaredDistance = "
<<
squaredDistance
<<
std
::
endl
;
std
::
cout
<<
"Distance = "
<<
distance
<<
std
::
endl
;
Loading