Angle difference
#9
(01-31-2023, 08:12 PM)bplus Wrote: When I was trying to include OldMoses code I got stuck a bit on converting Spinner_Dot to an angle but I went ahead with my adjustment to +/- returns of Angle Degree measure.

If you want the angle between two spiders movement vectors <.dx, .dy>, based on the return from Spinner_Dot :

angle in degrees = _R2D(_ACOS(Spinner_Dot(s1, s2)))

Spinner_Dot should return a SINGLE between 1 and -1. The same range as COS(0 - 180)

-1 = moving 180 degrees opposite each other
0 = moving on perpendicular courses
1 = moving parallel in same direction

Note: this only applies to unit vectors, which is why Spinner_Dot divides the components by the magnitudes

Dot product doesn't care about 180-360, it's treated the same as 0 to 180
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
Angle difference - by bplus - 01-31-2023, 05:04 PM
RE: Angle difference - by MasterGy - 01-31-2023, 05:50 PM
RE: Angle difference - by OldMoses - 01-31-2023, 06:15 PM
RE: Angle difference - by bplus - 01-31-2023, 06:44 PM
RE: Angle difference - by OldMoses - 01-31-2023, 07:33 PM
RE: Angle difference - by bplus - 01-31-2023, 08:12 PM
RE: Angle difference - by OldMoses - 01-31-2023, 10:32 PM
RE: Angle difference - by SMcNeill - 01-31-2023, 09:29 PM
RE: Angle difference - by bplus - 01-31-2023, 10:03 PM



Users browsing this thread: 5 Guest(s)