# Translation using Math

Hello,

My apologies if this post is in the wrong forum. I am currently creating a model of a train which is my first openGL project.

I have a set of large wheels which I wish to be connected together with a bar - imagine an old steam train.

Below is a screenshot of what I have so far.

I want the blue bar to give the impression that is is connected to the 3 large wheels, however I am not the best at maths, and do not know how to perform the sin & cos calculations to make it translate in a circle! I need to be able to control the speed of the movement so that it matches the rotation of the wheels

Not really OpenGL question butâ€¦ I guess you are saying that the wheels kind of slide on the bar instead of really rolling over it.

The train should translate by the arc length matching the angle of rotation of the big wheel. If you are controlling the angle, you want to compute the translation (arc length):

Formula: s = r*angle;

s = arc length (in the unit you want)
r = radius of the circle (in the same unit as arc length)