Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Please play nicely.  No one wants to listen/read a keyboard warriors rants....

Pages: [1]   Go Down

Author Topic: One for the Maths Guru's...  (Read 704 times)

0 Members and 1 Guest are viewing this topic.

PaulW

  • Omega Knight
  • *****
  • Offline Offline
  • Gender: Male
  • Somewhere near Manchester
  • Posts: 1769
  • Come on you fiend!
    • Some crappy Insignia
    • View Profile
One for the Maths Guru's...
« 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??
Logged
Humbugs...

Darth Loo-knee

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • Death Star
  • Posts: 18826
  • Jammie smells of Pooh....
    • TIE Fighter
    • View Profile
Re: One for the Maths Guru's...
« Reply #1 on: 30 November 2008, 22:31:16 »

Better go and wake my daughter up for that one  :D
Logged
Everything to do with Omega's. Breaking, Servicing from Cambelts to Oil Changes... Please Pm me for details...

Andy B

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Bury Lancs
  • Posts: 39805
    • ML350 TDM SmartRoadster
    • View Profile
Re: One for the Maths Guru's...
« Reply #2 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
Logged

PaulW

  • Omega Knight
  • *****
  • Offline Offline
  • Gender: Male
  • Somewhere near Manchester
  • Posts: 1769
  • Come on you fiend!
    • Some crappy Insignia
    • View Profile
Re: One for the Maths Guru's...
« Reply #3 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
Logged
Humbugs...

Darth Loo-knee

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • Death Star
  • Posts: 18826
  • Jammie smells of Pooh....
    • TIE Fighter
    • View Profile
Re: One for the Maths Guru's...
« Reply #4 on: 30 November 2008, 22:44:19 »

Was going to say that  ;D
Logged
Everything to do with Omega's. Breaking, Servicing from Cambelts to Oil Changes... Please Pm me for details...

PaulW

  • Omega Knight
  • *****
  • Offline Offline
  • Gender: Male
  • Somewhere near Manchester
  • Posts: 1769
  • Come on you fiend!
    • Some crappy Insignia
    • View Profile
Re: One for the Maths Guru's...
« Reply #5 on: 01 December 2008, 13:09:43 »

all that just to build a tower...



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
Logged
Humbugs...
Pages: [1]   Go Up
 

Page created in 0.009 seconds with 17 queries.