forked from svanacker/cen-electronic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bezier.txt
62 lines (44 loc) · 1.06 KB
/
bezier.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Point bezierPoints[4];
bezierPoints[0].x = 0;
bezierPoints[0].y = 0;
bezierPoints[1].x = -1;
bezierPoints[1].y = 4;
bezierPoints[2].x = 12;
bezierPoints[2].y = 5;
bezierPoints[3].x = 10;
bezierPoints[3].y = 7;
putString("bezierArcDistances:");
println();
putString("t\tx\ty\tdist\tdistAdd");
println();
float bezierArcLength = computeBezierArcLength(bezierPoints);
putString("bezierArcLength:");
println();
sendDec(bezierArcLength);
println();
putString("Bezier points:");
println();
writeBezierSpline(bezierPoints);
putString("Distances");
println();
putString("IndexOfLargestValue");
println();
float t;
float t1;
for (t = 0; t <= 1; t += 0.05) {
sendDec((long) (t * 1000));
putc('\t');
// computes the distance at t
float distance = getDistanceLengths(t, bezierPoints);
sendDec((long) (distance * 1000));
putc('\t');
// returns the time at the distance (inverse function)
t1 = computeBezierTimeAtDistance(distance);
sendDec((long) (t1 * 1000));
println();
}
while (1) {
}
*/
}