Skip to content

Commit 2970649

Browse files
committed
Minor tweaks to C++ UsingZ sample app
1 parent a262565 commit 2970649

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CPP/Examples/UsingZ/UsingZ.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ void Test2_Double()
175175
RectD r = GetBounds(subject);
176176
PointD mp = r.MidPoint();
177177
double d = (mp.y - r.top) / 255;
178-
// for each point in subject set, 'z' as the distance fron 'mp'
179-
// relative to 'd' and then scale to 255
178+
// for each point in subject, set its 'z' as a
179+
// relative distance fron 'mp' (scaled to 255)
180180
for (PathD& path : subject)
181181
for (PointD& pt : path)
182-
pt.z = std::sqrt(DistanceSqr(pt, mp)) / d;
182+
pt.z = Distance(pt, mp) / d;
183183
Triangulate(subject, 0, sol, true);
184184
DisplayAsSvg("coral3_t2.svg", nullptr, nullptr, &sol, true);
185185
}

0 commit comments

Comments
 (0)