Find angle of triangle(or polar projection)

Homer

New Member
Reaction score
2
Its been awhile since I've used Acos and Asin to find an angle.

Here is what I am doing as of now
JASS:
set mag=SquareRoot((this.xforce*this.xforce)+(this.yforce*this.yforce))
        if mag!=0 then
        if this.yforce!=0 then
        set dir = Acos(((mag*mag)+(this.yforce*this.yforce)-(this.xforce*this.xforce))/(2*mag*this.yforce))
        endif
        endif


However, this must not be correct cuz the values it is returning are obscure. I do not believe it is even returning the correct radians if it is indeed returning radians instead of degrees. I believe my formula is incorrect.

Let me know if my explanation is poor, or rather if you are unable to follow what I am trying to get at.
 

Homer

New Member
Reaction score
2
Not exactly what i'm trying to do. Basicly the engine im working on has a very basic physic simulation where it has friction, gravity and the direction in which its moving. In order to add force to the existing one easily I manage the force at the x and y levels rather then speed and direction.
I'm looking to convert the x and y's back into speed and direction. I've gotten the speed part(just a simple pathag equation) however I can not seem to get the angle back. The reason I am trying to get back to this form is to apply friction. Because applying a constant friction on the two vector forces(x,y) is inaccurate and causes a swaying like effect when one of the two forces reaches 0.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top