Skip to content

Commit 5150caf

Browse files
committed
remove commented lines and add mention to source article
1 parent c4cfe43 commit 5150caf

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

apps/bot_manager/lib/spline_path.ex

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule SplinePath do
22
@moduledoc """
33
This module defines methods to generate a spline path out of a waypoint path
4+
5+
Based on https://qroph.github.io/2018/07/30/smooth-paths-using-catmull-rom-splines.html
46
"""
57
alias BotManager.Math.Vector
68

@@ -31,29 +33,6 @@ alias BotManager.Math.Vector
3133
|> List.flatten()
3234
end
3335

34-
# float t01 = pow(distance(p0, p1), alpha);
35-
# float t12 = pow(distance(p1, p2), alpha);
36-
# float t23 = pow(distance(p2, p3), alpha);
37-
38-
# vec2 m1 = (1.0f - tension) *
39-
# (p2 - p1 + t12 * (
40-
# (p1 - p0) / t01 - (p2 - p0) / (t01 + t12)
41-
# )
42-
# );
43-
# vec2 m2 = (1.0f - tension) *
44-
# (p2 - p1 + t12 * ((p3 - p2) / t23 - (p3 - p1) / (t12 + t23)));
45-
#
46-
# Segment segment;
47-
# segment.a = 2.0f * (p1 - p2) + m1 + m2;
48-
# segment.b = -3.0f * (p1 - p2) - m1 - m1 - m2;
49-
# segment.c = m1;
50-
# segment.d = p1;
51-
#
52-
# vec2 point = segment.a * t * t * t +
53-
# segment.b * t * t +
54-
# segment.c * t +
55-
# segment.d;
56-
5736
defp build_points_for_spline([p0, p1, p2, p3]) do
5837
t01 = :math.pow(Vector.distance(p0, p1), @alpha)
5938
t12 = :math.pow(Vector.distance(p1, p2), @alpha)

0 commit comments

Comments
 (0)