CNC | Coordinate Geometry

One of the first major steps towards basic understanding of CNC principles and geometrical concepts is thorough understanding of a subject known in mathematics as the system of coordinates. System of coordinates is founded on a number of mathematical principles dating back over four hundred years. The most important of these principles are those that can be applied to CNC technology of today. In various publications on mathematics and geometry, these principles are often listed under the headings such as the real number system and the rectangular coordinates.

Real Number System

One main key to understanding rectangular coordinates is understanding of basic math – arithmetic, algebra and geometry. The key knowledge in this area is knowledge of the real number system. Within the real number system, there are ten available numerals (digits), 0 to 9 (zero to nine), that can be used in any of the following groups:

  • Zero integer ( 0 )
  • Positive integers (1, 2, +3, 10, 12943, +45 ) (with or without sign)
  • Negative integers ( -4, -381, -25, -77 ) (minus sign required)
  • Fractions ( 1/8, 3/16, 9/32, 35/64 )
  • Decimal fractions ( 0.185, 0.2, 0.546875, 3.5, 15.0 )

All groups are used on a daily basis. These groups represent the mainstream of just about all applications of numbers in modern life. In CNC programming, the primary goal is to use numbers to ‘translate’ engineering drawing – based on its dimensions – into a specific cutter path.
Computerized Numerical Control means control by the numbers using a computer. All drawing information has to be translated into CNC program, using primarily numbers. Numbers are also used to describe commands, functions, comments, and so on. The mathematical concept of a real number system can be expressed graphically on a horizontal or a vertical line, called the number scale, where all divisions have the same length – Figure 4-1.

Figure 4-1 – Graphical representation of the Number Scale

Length of each division on the scale represents the unit of measurement in a convenient and generally accepted scale. It may come as a surprise that this concept is used every day. For example, a simple ruler used in schools is based on the number scale concept, regardless of measuring units. Weight scales using tons, pounds, kilograms, grams and similar units of mass are other examples. A simple household thermometer uses the same principle. Other similar examples are available as well.

Rectangular Coordinate System

Rectangular coordinate system is a concept used to define a planar 2D point (two dimensions), using the XY coordinates, or a spacial 3D point (three dimensions), using the XYZ coordinates. This system was first defined in the 17th century by a French philosopher and mathematician Rene Descartes (1596-1650). His name is used as an alternative name of the rectangular coordinate system, it is called the Cartesian Coordinate System – see Figure 4-2.

Figure 4-2 – Rectangular coordinate system = Cartesian coordinate system

The concepts used in design, drafting and in numerical control are over 400 years old. A given point can be mathematically defined on a plane (two coordinate values) or in space (three coordinate values). The definition of one point is relative to another point as a distance parallel with one of three axes that are perpendicular to each other. In a plane, only two axes are required, in space, all three axes must be specified. In programming, point represents an exact location. If such a location is on a plane, the point is defined as a 2D point, along two axes. If the location is in space, the point is defined as a 3D point, along three axes.
When two number scales that intersect at right angles are used, mathematical basis for a rectangular coordinate system is created. Several terms emerge from this representation, and all have an important role in CNC programming. Their understanding is very important for further progress.

Axes and Planes

Each major line of the number scale is called an axis. It could have either vertical or horizontal orientation. This very old principle, when applied to CNC programming, means that at least two axes – two number scales – will be used. This is the mathematical definition of an axis:

An axis is a straight line passing through the center of a plane or a solid figure, around which the parts are symmetrically arranged.

This definition can be enhanced by a statement that an axis can also be a line of reference. In CNC programming, an axis is used as a reference all the time. The definition also contains the word ‘plane’.A plane is a term used in 2D applications, while a solid object is used in 3D applications. Mathematical definition of a plane is:

A plane is a surface in which a straight line joining any two of its points will lie wholly on the surface.

From the top viewpoint of the observer, looking straight down on the illustration Figure 4-3, a viewing direction is established. This is often called viewing a plane.

Figure 4-3 – Axis designation – viewing a plane Mathematical designation is fully implemented in CNC

A plane is a 2D entity – the letter X identifies its horizontal axis, the letter Y identifies its vertical axis. Such plane is called the XY plane. Defined mathematically, the horizontal axis is always listed as the first letter of the pair. In drafting and CNC programming, this plane is also known as the Top View or a Plan View. Other planes are also used in CNC, but not to the same extent as in CAD/CAM work.

Point of Origin

Another term that emerges from the rectangular coordinate system is called the point of origin, or just origin. It is the exact point where the two perpendicular axes intersect. This point has a zero coordinate value in each axis, specified as planar X0Y0 and spacial X0Y0Z0 – Figure 4-4.

Figure 4-4 – Point of origin – intersection of axes

This intersection called origin has a rather special meaning in CNC programming. This origin point acquires a new name, one typically called the program reference point. Other terms are also used: program zero, part reference point, workpiece zero, part zero, and probably a few others – all with the same meaning and same purpose.


Viewing the two intersecting axes and the new plane, four distinct areas can be clearly identified. Each area is bounded by two axes. These areas are called quadrants. Mathematically defined,

A quadrant is any one of the four parts of the plane formed by the system of rectangular coordinates

The word quadrant, from Latin word quadrans or quadrantis, means the fourth part. It suggests four uniquely defined areas or quadrants. Looking down in the top view at the two intersecting axes, the following definitions apply to quadrants. They are mathematically correct and are used in all CNC/CAD/CAM applications:

Quadrants are always defined in the counterclockwise direction, from the horizontal X-axis and the naming convention uses Roman – not Arabic – numbers normally used.
Numbering of quadrants always starts at the positive side of the horizontal axis. Figure 4-5 illustrates the definitions.

Figure 4-5 – Quadrants in the XY plane and their identification

Any point coordinate value can be positive, negative or zero. All point coordinates are determined solely by their location in a particular quadrant and individual distances along an axis, again, relative to origin – Figure 4-6.

Figure 4-6 – Algebraic signs for a point location in plane quadrants


  • If the defined point lies exactly on the X-axis, it has the Y value equal to zero (Y0)
  • If the point lies exactly on the Y-axis, it has the X value equal to zero (X0)
  • If the point lies exactly on both X and Y axes, both X and Y values are zero (X0 Y0).

X0Y0Z0 is the point of origin. In part programming, positive values are written without the plus sign – Figure 4-7.

Right Hand Coordinate System

In all illustrations of number scale, quadrants and axes, the origin divides each axis into two portions. The zero point – the point of origin – separates the positive section of an axis from the negative section. In the right-hand coordinate system, the positive axis starts at origin and is directed towards the right for X-axis, upwards for Y-axis and towards the perpendicular viewpoint for Z-axis. Opposite directions are always negative.

Figure 4-7 – Coordinate definition of points within rectangular coordinate system Point P1 = Origin = X0Y0

If these directions were superimposed over a human right hand, they would correspond to the direction from the root of thumb or finger towards its tip. Thumb would point in the X+ direction, index finger in the Y+ direction and middle finger in the Z+ direction.
CNC machines are normally programmed using the so called absolute coordinate method, that is based on the point of origin being X0Y0Z0. This absolute programming method follows very strictly the rules of rectangular coordinate geometry.

Machine Geometry

Machine geometry defines the relationship of distances and dimensions between fixed point of the machine and selectable point of the part. Typical geometry of CNC machines uses the right hand coordinate system. Positive and negative axis direction is determined by an established viewing convention. The general rule for Z-axis is that it is always the axis along which a simple hole can be machined with a single point tool, such as a drill, reamer, wire, laser beam, etc. Figure 4-8 illustrates standard orientation of planes for XYZ type machine tools.

Axis Orientation – Milling

A typical vertical machining center has three controlled axes, defined as X-axis, Y-axis, and Z-axis. X-axis is parallel to the longest dimension of machine table, Y-axis is parallel to the shortest dimension of the table and Z-axis is the spindle movement. On a vertical CNC machining center, X-axis is the table longitudinal direction, Y-axis is the saddle cross direction, and Z-axis is the spindle direction.

Figure 4-8 – Standard orientation of planes and CNC machine tool axes

For CNC horizontal machining centers, the terminology is changed due to design of these machines. X-axis is the table longitudinal direction, Y-axis is the column direction and Z- axis is the spindle direction. Horizontal machine can be viewed as a vertical machine rotated in space by ninety degrees. Additional feature of a horizontal machining center is indexing B-axis. Typical machine axes applied to CNC vertical machines are illustrated in Figure 4-9.

Figure 4-9 – Basic axes of a typical vertical CNC machining center

Axis Orientation – Turning

Standard CNC lathes have two axes, X and Z. More axes are available, but they are not important at this point. Special additional axes, such as C-axis and Y-axis, are designed for milling operations (live tooling) and require unique version of a standard CNC lathe.
What is much more common for CNC lathes in industry, is the double orientation of XZ axes. CNC lathes are separated as front and rear lathes. An example of a front lathe is similar to the conventional engine lathe. All slant bed lathe types are of the rear kind. Identification of axes in industry have not always followed mathematical principles.

Figure 4-10 – Typical machine axis orientation for various CNC lathes

Another lathe variety, a vertical CNC lathe, is basically a horizontal lathe rotated 90°. Typical axes for horizontal and vertical machine axes, as applied to turning, are illustrated in Figure 4-10.

Additional Axes

A CNC machine of any type can be designed with one or more additional axes, normally designated as the secondary – or parallel – axes using the U, V and W letters. These axes are normally parallel to the primary X, Y and Z axes respectively. For a rotary or an indexing applications, additional axes are defined as A, B and C axes, as being rotated about the X, Y and Z axes, again in their respective order. Positive direction of a rotary (or an indexing) axis is the direction required to advance a right handed screw in the positive X, Y or Z axis. Relationship between the primary and supplementary axes is shown in Figure 4-11.

Figure 4-11 – Relationship of primary and supplementary machine axes

Arc center modifiers (sometimes called arc center vectors) are not true axes, yet they are also related to primary axes XYZ.