Omega Owners Forum
Chat Area => General Discussion Area => Topic started by: PaulW on 30 November 2008, 22:29:26
-
Yes I know its a Sunday night, but I'm tearing my hair out here!!
I need a formula to work out coordinates on a 2D axis given rotation angle and position from central XY coordinates...
So, for example..
X=0, Y=0
Angle = 0
Distance = 10
That would mean X1=10, Y1=0
But I need a formula to calculate X1 and Y1 dependant on whats entered for Angle and Distance.
I've tried various things in regards to working out rotations (x*cos(angle)-y*sin(angle)) malarky, but get some stupid results in the spreadsheet...
Any helpers??
-
Better go and wake my daughter up for that one :D
-
Yes I know its a Sunday night, but I'm tearing my hair out here!!
I need a formula to work out coordinates on a 2D axis given rotation angle and position from central XY coordinates...
So, for example..
X=0, Y=0
Angle = 0
Distance = 10
That would mean X1=10, Y1=0
But I need a formula to calculate X1 and Y1 dependant on whats entered for Angle and Distance.
I've tried various things in regards to working out rotations (x*cos(angle)-y*sin(angle)) malarky, but get some stupid results in the spreadsheet...
Any helpers??
Errrrr! No! Sorry Paul. I can remember that Some Old Horses Canter Across somewhere ........ ::) :y :y :y
-
Its ok, finally figured it...
RAngle = Angle / 180 * Pi
x1 = cos(RAngle) * Radius + X
y1 = sin(RAngle) * Radius + Y
:y
-
Was going to say that ;D
-
all that just to build a tower...
(http://i130.photobucket.com/albums/p266/PaulW21781/chimeneh.png)
but not happy with the code, so started re-coding it... it's due on the 15th and I still need to implement physics and collision detection... :-X