Working out I and J by hand intimidates beginners, but the entire calculation is one rule: subtract the start point from the center, coordinate by coordinate. Every wrong arc traced back to this calculation comes from subtracting the wrong pair of points or dropping a sign.
What are I and J measuring?
I and J describe the straight-line offset from the arc’s start point to the arc’s center: I along X, J along Y. They are a small vector on the ordinary Cartesian grid, and on standard controls they are incremental, measured from the start point, as the LinuxCNC arc format specifies. (If you are still deciding whether to use this format or the simpler radius word at all, the R versus I/J overview covers that choice first.) The start point is simply wherever the previous move left the tool.
So the rule is:
I = center X - start X
J = center Y - start Y
Keep the signs exactly as the subtraction produces them. A center left of the start point gives a negative I; a center below gives a negative J.
A worked example, step by step
The tool sits at X20. Y10. and the drawing shows a 5 mm radius arc around a center at X15. Y10., ending at X10. Y10.:
| Step | Calculation | Result |
|---|---|---|
| Start point | from the previous move | X20, Y10 |
| Center | from the drawing | X15, Y10 |
I | 15 - 20 | -5.0 |
J | 10 - 10 | 0 |
| Radius check | sqrt((-5)^2 + 0^2) | 5.0 ✓ |
The block comes out as:
G02 X10. Y10. I-5. J0 F150
The negative I is doing real work: it says the center lies five units in the negative X direction from where the arc begins.
A second example with both offsets
Start point X0 Y0, center at X3. Y4., full circle back to the start. The subtraction gives I3. J4., and the radius check gives the hypotenuse: the square root of 9 plus 16 is 5, so this is a 5 mm radius circle:
G02 X0 Y0 I3. J4. F150 (full circle, center up and to the right)
Full circles are the case where this calculation is unavoidable, because the radius word cannot define them, the limitation explained in I, J, K vs R in G02. The same start-to-center subtraction, generalized to many points, is how a bolt hole circle’s coordinates get computed with sine and cosine.
How do you verify the numbers before running?
The radius gives you a two-step self-check that catches nearly every slip. First, I and J span start-to-center, so the square root of I squared plus J squared must equal the arc radius. Second, the center must sit at that same radius from the endpoint, because both ends of an arc lie on the circle. Run both checks; if they disagree, one of your three inputs (start, end, center) is wrong. Controls enforce this geometry, and an inconsistent arc either alarms or cuts a shape you did not intend, one of the failure paths covered in why G02 cuts a straight line.
Where do the calculations go wrong?
Three mistakes account for almost all bad I J values:
| Mistake | What happens | Guard |
|---|---|---|
Using the center’s absolute coordinates as I J | Center lands far from the arc | Always subtract the start point |
| Measuring from the endpoint | Mirrored or shifted center | The start point is the reference |
| Dropped minus sign | Arc bulges the wrong way | Keep signs from the subtraction |
The direction of travel around that center is the separate clockwise question settled by G02 vs G03, and the standard code references list both forms of the arc words for quick lookup.
Bottom line
I and J are the center minus the start point, sign included: one subtraction for X, one for Y. Verify with the radius twice, start-to-center and center-to-end, and the arc is proven before the machine ever sees it. Making that subtraction rule reflex is a recall job, and a routine on the G-code practice hub handles it alongside the codes themselves.
Sources
- LinuxCNC G-code reference (G2/G3 incremental arc centers)
- Wikipedia: Cartesian coordinate system
- CNCCookbook: G-code and M-code cheat sheet
Frequently asked questions
How do you calculate I and J for a G02 arc?
Subtract the start point from the center: I equals center X minus start X, J equals center Y minus start Y, signs kept. An arc starting at X20 Y10 around a center at X15 Y10 gets I-5. J0.
Are I and J measured from the start point or the end point?
From the start point on standard controls. Computing from the endpoint is the most common mistake and misplaces the center.
How do you check that I and J are correct?
The square root of I squared plus J squared must equal the radius, and the center must sit at the same radius from the endpoint. If the two distances disagree, one of the inputs is wrong.
What is the best way to learn arc calculations like I and J?
Drill the rule with active recall and practice on paper arcs. A free app like G-Code Sprint quizzes G02, G03, and the arc words and repeats whichever ones you miss.
G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.