Something about X Y's and Directions

Does anybody know of some kind of reverse SINE

&COSINE, because I have two XY positions and I want to find out what direction they are..


Just in case you are wondering, I have created a raycaster that finds walls, and it finds the wall somewhere in the middle. Its kinda hard to explain, but I only want the wall's position(XY) in INTEGERS and the direction from (0,0) with the distance.


Thanks.


Comments

  • : Does anybody know of some kind of reverse SINE

    : &COSINE, because I have two XY positions and I want to find out what direction they are..


    In BP, there is only one such function: ArcTan.

    It gives the arcustangent of its argument. But it is

    quite easy to compute values of ArcCos and ArcSin from it:

    ArcSin(x) = ArcTan (x/sqrt (1-sqr (x)))

    ArcCos(x) = ArcTan (sqrt (1-sqr (x)) /x)

    (See BP help on ArcTan)


    As you can see, it is quite computationaly expensive,

    but I hope you are using some look-up tables, aren't you?


    Greetings,

    Peter "Dragon" Kadlec


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories