Scott Lahteine 5 years ago
parent
commit
56595a4c9c
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/gcode/motion/G2_G3.cpp

+ 1
- 1
Marlin/src/gcode/motion/G2_G3.cpp View File

@@ -287,7 +287,7 @@ void GcodeSuite::G2_G3(const bool clockwise) {
287 287
           const xy_pos_t d = p2 - p1, m = (p1 + p2) * 0.5f;   // XY distance and midpoint
288 288
           const float e = clockwise ^ (r < 0) ? -1 : 1,       // clockwise -1/1, counterclockwise 1/-1
289 289
                       len = d.magnitude(),                    // Total move length
290
-                      h = SQRT(sq(r) - sq(len * 0.5f));       // Distance to the arc pivot-point
290
+                      h = SQRT((r - d * 0.5f) * (r + d * 0.5f)); // Distance to the arc pivot-point
291 291
           const xy_pos_t s = { d.x, -d.y };                   // Inverse Slope of the perpendicular bisector
292 292
           arc_offset = m + s * RECIPROCAL(len) * e * h - p1;  // The calculated offset
293 293
         }

Loading…
Cancel
Save