Interactive Modular Arithmetic

This interactive demonstrates the properties of modular arithmetic on a number-line. Click and drag the point to change the input number. is the same as dividing x by a and returning the remainder of the division.

An alternative way to visualize modular arithmetic is through rotation:

The total rotation mod 360 is equal to the current angle in degrees. Click and drag the control point to change the total rotation. The equation below describes this mathematically:

Where r represents the total rotation, 360 ° represents one full rotation, and θ represents the current angle or direction.