TGC Codebase Backup



Angle Function by Mortus

28th May 2007 12:04
Summary

Gets the angle in degrees from point x1#,y1# to point x2#,y2#



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Function Angle(X1#,Y1#,X2#,Y2#)
   XDist# = X2# - X1#
   YDist# = Y2# - Y1#
   Ret# = ATanfull(XDist#,YDist#)
   if Ret# < 0 then Ret# = 360 + Ret#
   Ret# = 90 - Ret#
Endfunction Ret#