On Jan 5, 2012, at 11:23 AM, Eric E. Dolecki wrote: > Hmmm... > > I have a UITextView in the center of my app. I want to base the origin on > that object. > CGFloat rads = atan(height/width); > From the top I get 90... around to the right side I get down to 0... then > around from right to bottom -0 to -90 then around to left side 90 to 0 and > then back to top from left side -0 to -90. > As Marco's code showed, you want to use atan2() not atan(), as atan() doesn't know which quadrant to use (you could do the work yourself, but its not worth it). -- David Duncan
_______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
