Omega Owners Forum

Chat Area => General Discussion Area => Topic started by: PaulW on 30 November 2008, 22:29:26

Title: One for the Maths Guru's...
Post 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??
Title: Re: One for the Maths Guru's...
Post by: Darth Loo-knee on 30 November 2008, 22:31:16
Better go and wake my daughter up for that one  :D
Title: Re: One for the Maths Guru's...
Post by: Andy B on 30 November 2008, 22:36:25
Quote
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
Title: Re: One for the Maths Guru's...
Post by: PaulW on 30 November 2008, 22:43:33
Its ok, finally figured it...

RAngle = Angle / 180 * Pi
x1 = cos(RAngle) * Radius + X
y1 = sin(RAngle) * Radius + Y

 :y
Title: Re: One for the Maths Guru's...
Post by: Darth Loo-knee on 30 November 2008, 22:44:19
Was going to say that  ;D
Title: Re: One for the Maths Guru's...
Post by: PaulW on 01 December 2008, 13:09:43
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