Created
April 22, 2014 21:02
-
-
Save ryanbillingsley/11194199 to your computer and use it in GitHub Desktop.
Finds a point on a circle with a given radius and degree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI)) | |
#define DEGREES_TO_RADIANS(degrees) ((degrees) * (M_PI / 180.0)) | |
- (CGPoint)determinePointOnCircleWithRadius:(int)radius Degree:(int)degree Center:(CGPoint)startPoint | |
{ | |
float midX = startPoint.x + radius * cos(DEGREES_TO_RADIANS(degree)); | |
float midY = startPoint.y + radius * sin(DEGREES_TO_RADIANS(degree)); | |
return CGPointMake(midX, midY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment