Advertisement
TheFastFish

A buncha SmileBASIC functions

Mar 11th, 2015
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. DEF REC2POL X,Y OUT R,A
  2. R=SQR(X*X+Y*Y)
  3. A=ATAN(Y/X)
  4. RETURN
  5. END
  6.  
  7. DEF POL2REC R,A OUT X,Y
  8. X=R*COS(RAD(A))
  9. Y=R*SIN(RAD(A))
  10. RETURN
  11. END
  12.  
  13. DEF ROTCOORD X,Y,A OUT X2,Y2
  14. CS=COS(RAD(A))
  15. SN=SIN(RAD(A))
  16. X2=X*CS-Y*SN
  17. Y2=X*SN+Y*CS
  18. RETURN
  19. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement