I am trying to draw a pixel in a specific place within a rectangle. there is a movable turret and I want to draw at a point directly at the end of this turret. Now when I draw at the left side of the screen it works flawlessly. but when I get to the right side of the screen and want to draw the pixel so it would be perceived as moving back toward the left the pixel draws at the exact opposite side of the rect that it should. Basically I simply need to invert it's X coord but I cannot seem to figure out how.

theX = turretBottom.x + 103* sin(angle * PI/180);

Above is what I am using to get the X coord now I need it exactly opposite the point it appears at. 103 is the height of the turret. angle is the angle it is in relation to the platform it sits on. (moves from 0 to 75 degrees)

Any one out there who knows more about math than me who might be able to help me invert this X coord?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to