mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
Review changes (indentation, spaces)
This commit is contained in:
@@ -75,20 +75,20 @@ void Turtle::circle(mp_int_t radius, mp_float_t angle) {
|
|||||||
mp_float_t oldHeading = heading();
|
mp_float_t oldHeading = heading();
|
||||||
mp_float_t length = std::fabs(angle * k_headingScale * radius);
|
mp_float_t length = std::fabs(angle * k_headingScale * radius);
|
||||||
int direction = 1; // 1=fwd, -1=backward
|
int direction = 1; // 1=fwd, -1=backward
|
||||||
if (angle < 0) {direction =-1;}
|
if (angle < 0) { direction =-1; }
|
||||||
if (length > 1) {
|
if (length > 1) {
|
||||||
for (int i = 1; i < length; i++) {
|
for (int i = 1; i < length; i++) {
|
||||||
mp_float_t progress = i / length;
|
mp_float_t progress = i / length;
|
||||||
// Move the turtle forward
|
// Move the turtle forward
|
||||||
if (forward(direction)) {
|
if (forward(direction)) {
|
||||||
// Keyboard interruption. Return now to let MicroPython process it.
|
// Keyboard interruption. Return now to let MicroPython process it.
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
setHeadingPrivate(oldHeading+std::copysign(angle*progress, direction*radius));
|
|
||||||
}
|
}
|
||||||
forward(direction);
|
setHeadingPrivate(oldHeading+std::copysign(angle*progress, direction*radius));
|
||||||
setHeading(oldHeading+std::copysign(angle, direction*radius));
|
|
||||||
}
|
}
|
||||||
|
forward(direction);
|
||||||
|
setHeading(oldHeading+std::copysign(angle, direction*radius));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user