Find the I and J offsets (arc center, relative to the start point) for a G02 (clockwise) or G03 (counterclockwise) circular interpolation move, given the start point, end point, and radius. Also returns the absolute arc center, sweep angle, and arc length.
Arc Setup
Results
I and J are incremental offsets from the start point to the arc center — this is the convention used by G02/G03 on virtually all controls (Fanuc, Haas, Siemens) regardless of whether G90 or G91 is active for linear moves. If your control supports G90.1/G91.1, double-check whether it expects I/J as absolute instead.
Sample G-Code Line
| G02 X2.0 Y2.0 I0.0 J2.0 |
How It Works
Given a chord between the start and end points, the radius determines a height h above the chord’s midpoint where the center must sit, using the Pythagorean relationship h = √(r² − (d/2)²), where d is the chord length. There are always two candidate centers, one on each side of the chord. The direction (G02/G03) and arc sweep (minor/major) together determine which of the two candidates is correct. If d is greater than 2r, no circle of that radius can connect the two points and the radius must be increased.
FAQ
Why does my arc move the wrong way? Swap the Direction setting, or switch the Arc Sweep between minor and major — for any two points and a given radius, there are up to four distinct arcs (two directions × two sweeps), and only one matches what you intend.
Can I use this for R-format arcs instead of I/J? Yes — use the Radius result directly in an R-format line (e.g. G02 X.. Y.. R2.0), but remember to make R negative for a major (>180°) arc on controls that support that convention.
Related Guides
G02 Command (Clockwise Arc) · G03 Command (Counterclockwise Arc) · G-Code Cheat Sheet · Hole Pattern Calculator
