Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e513bf0

Browse files
committed
bezier: move eval function back to bezier file
1 parent fb1f0e6 commit e513bf0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

‎Bezier.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,14 @@ Point Bezier::linerp(Point a, Point b, int t)
2424
{
2525
return a + ((b - a) * ((float)t / 1023));
2626
}
27+
28+
Point Bezier::eval(int t)
29+
{
30+
Point ab = Bezier::linerp(this->A, this->B, t);
31+
Point bc = Bezier::linerp(this->B, this->C, t);
32+
Point cd = Bezier::linerp(this->C, this->D, t);
33+
Point abbc = Bezier::linerp(ab, bc, t);
34+
Point bccd = Bezier::linerp(bc, cd, t);
35+
Point ret = Bezier::linerp(abbc, bccd, t);
36+
return ret;
37+
}

‎FlightStick.ino

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ void blink(int led, int cycles, int on_millis = 500, int delay_millis = -1)
4141
}
4242
}
4343

44-
Point Bezier::eval(int t)
45-
{
46-
Point ab = Bezier::linerp(this->A, this->B, t);
47-
Point bc = Bezier::linerp(this->B, this->C, t);
48-
Point cd = Bezier::linerp(this->C, this->D, t);
49-
Point abbc = Bezier::linerp(ab, bc, t);
50-
Point bccd = Bezier::linerp(bc, cd, t);
51-
Point ret = Bezier::linerp(abbc, bccd, t);
52-
return ret;
53-
}
54-
5544
void calibration()
5645
{
5746
// Properties

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /