Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find that angle
#1
a little function to find the angle (measured in radians) from point x1,y1 to point x2,y2

Code: (Select All)
Function Rtan2 (x1, y1, x2, y2)
'========================
' returns an angle in radians between points x1,y1 and x2,y2
    deltaX = x2 - x1
    deltaY = y2 - y1
    rtn = _Atan2(deltaY, deltaX)
    If rtn < 0 Then Rtan2 = rtn + (2 * _Pi) Else Rtan2 = rtn
End Function
Reply
#2
I love _ATAN2, no trapping for division by zero required.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply
#3
Yeah don't even have to go to Florida!
b = b + ...
Reply




Users browsing this thread: 1 Guest(s)