How to calculate a point with an given center, angle and radius?
Posted
by mystify
on Stack Overflow
See other posts from Stack Overflow
or by mystify
Published on 2010-05-26T12:12:46Z
Indexed on
2010/05/26
12:21 UTC
Read the original article
Hit count: 224
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 10x10 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?
© Stack Overflow or respective owner