Code center > Darwinbots3
Boolean memory
Numsgil:
Yeah, angle between them is the difference in their relative angles.
And yes, it only really makes sense if A and B are directional vectors and not points.
The dot product is just:
A.x * B.x + A.y * B.y
Cross product is:
+/- (A.x * B.y - A.y * B.x)
(+/- depending on what "handedness" you're using).
ikke:
I remember learning this at Delft university. This has confronted me with the knowledge that I can no longer reproduce this on my own. Knowledge has a half life...
Botsareus:
Wow, this formula is awesome. Thx for teaching me that Numsgil. , I did some basic tests on it, I will do rigorous testing on it when I get a chance.
Botsareus:
I just realized I don't need to divide by (|A| * |B|) because all it does is rescale the triangle.
Numsgil:
if A and B are unit length, you don't need to. Or if they cancel out in some way later in the problem, you don't need to.
Navigation
[0] Message Index
[*] Previous page
Go to full version