|
@@ -290,8 +290,8 @@ void GcodeSuite::G2_G3(const bool clockwise) {
|
290
|
290
|
len = d2.magnitude(), // Distance to mid-point of move from current
|
291
|
291
|
h2 = (r - len) * (r + len), // factored to reduce rounding error
|
292
|
292
|
h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint
|
293
|
|
- const xy_pos_t s = { -d2.y, d2.x } / len; // Unit vector along perpendicular bisector
|
294
|
|
- arc_offset = d2 + s * e * h; // The calculated offset (mid-point if |r| <= len)
|
|
293
|
+ const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.)
|
|
294
|
+ arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len)
|
295
|
295
|
}
|
296
|
296
|
}
|
297
|
297
|
}
|