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!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Small Collection of Angle Conversion Functions TarotRedhand 4 1,214 05-17-2022, 03:35 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)