vectorToAngle explanation

Hello folks,
I am new to game salad and am just starting to prototype my first game. The first border I try to cross is the vectorToAngle function. Can someone explain more in depth how this function works? I don't want to know like "copy and paste vectorToAngle(x-x',y-y') and then it works" I want to know how the expression actually works.. the mathematics behind it. I generally understand what it does, but I don't understand how it is done. Especially the offset thingy.
Thanks for your time and your help! I will appreciate it a lot!!
greets
bjoern
I am new to game salad and am just starting to prototype my first game. The first border I try to cross is the vectorToAngle function. Can someone explain more in depth how this function works? I don't want to know like "copy and paste vectorToAngle(x-x',y-y') and then it works" I want to know how the expression actually works.. the mathematics behind it. I generally understand what it does, but I don't understand how it is done. Especially the offset thingy.
Thanks for your time and your help! I will appreciate it a lot!!
greets
bjoern
Comments
So vectorToAngle(actor1.self.position.x-actor2.self.posotion.x,actor1.self.position.y-actor2.self.position.y)
Another example is if you wanted actor1 to shoot at the mouse cursor position you can do this
vectorToAngle(actor1.self.position.x - mouse.position.x, actor1.self.position.y - mouse.postion.y)
I believe this is the droids you are looking for...
Vector Magnitude
Drag the non text actor around and notice the magnitude as you get closer and further.
Watch the angle as well.
thanks a lot for your help! I think I got it now
Great support wormil!! *cheering*