The Daily Click ::. Forums ::. Klik Coding Help ::. Here's an easy one...
 

Post Reply  Post Oekaki 
 

Posted By Message

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th December, 2006 at 10:32:54 -

... How the feck do you get the angle between two points again? MMF1.5 / MMF2, without using extensions.

 
n/a

Nick of All Trades

Possibly Insane

Registered
  03/09/2002
Points
  2312

Game of the Week Winner
15th December, 2006 at 11:22:07 -

Uh... how about making the one object, or an object ontop of that, look in the direction of the other? I dunno...
Can MMF do that?

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
15th December, 2006 at 11:24:52 -

Tan ((Y2-Y1)/(X2-X1))

 
My signature is never too big!!!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th December, 2006 at 11:35:42 -

Lol Nikodemus.

Joe: I tried that, but didn't really give me the result I was looking for. I want it to return an angle value from 0 to 360. Is there any way I could convert that stuff, Joe? Sorry for being a math/trig noob

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
15th December, 2006 at 11:38:25 -

1 radian = (180 /pi) degrees

Therefore just multiply it by 180/pi to go from radians to degrees


 
My signature is never too big!!!

Werbad



Registered
  18/09/2002
Points
  235
15th December, 2006 at 11:38:45 -

its supposed to be aTan, not Tan... But the problem with aTan is that it gives an answer int the range -90 to 90, so you have to make additional checks to get a correct angle... aTan2 takes 2 parameters, X and Y and gives a correct result, but aTan2 isn't included in MMF... at least not in MMF1.5

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
15th December, 2006 at 11:43:54 -

lol. I thought i missed something in my first post

It should be Atan... but my second one, if i remember rightly, should still be used as i think MMF gets the angle of atan in radians

The angle in MMF will never be more than 180 degrees

Or at least, it shouldnt be.

So basically if you have something more than 180 degrees, subtract 180 from it, if you have something < 0 add 180 to it until it becomes 0 <= angle <= 180



Image Edited by the Author.

 
My signature is never too big!!!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th December, 2006 at 13:58:16 -

Haha, yeah. Thanks guys

 
n/a
   

Post Reply



 



Advertisement

Worth A Click