I'm currently working on a mobile game which mainly consists of a rotating line and a ball. The line rotates 0.500 degrees clockwise around its center every frame. The ball is at first positioned in the centre of the line. When the user touches the screen, the ball should move along the line and when the user stops touching the screen the ball should move in the opposite direction.
I have the line rotation, and the coordinates of the line(top-left corner).
I need to find the position of the ball if the ball moves along the line at a speed of 5.