Rotating a wheel with circumference

When you figure out the circumference of a circle (wheel of a car), can you then rotate the wheel depending on how far the car has come? I mean if the wheel-circumference is 78 and the car has driven 78 pixels, then the wheel have rotated 360 degrees. Is there any solution to this?

When drawing the wheel, add the rotate() function. Make sure the wheel and rotate function are inside pushMatrix and popMatrix or else it will rotate everything drawn. Then use a simple formula such as:


Thanks! Smart solution