In this SO question, someone asked for calculating an angle from three points. I need to do the opposite thing.
I want to draw a clock, and I have tiny tick images. An art dude made 60 of them, each with an individual and accurate shadow. So there are 60 distinct images at 10×10 points in size, already correctly rotated in the center of that square.
So every 6 degrees one tick image has to be placed. I would just need to calculate the x/y coordinate based on a center point, an radius and an angle.
So I have:
- an center point
- an radius
- an angle
Is there an easy way to calculate the x/y coordinate with this? Maybe cocoa-touch already has a useful function or method for this?
let a be the angle, (x,y) the center point and r the radius, then your point will be at