SHARE
TWEET

Untitled

a guest Feb 16th, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2.  
  3. #for CC arch
  4. CPx = int(input("Center point x"))
  5. CPx = int(input("Center point x"))
  6.  
  7.  
  8. direct = input("CC or CW?")
  9. if direct == "CW":
  10.     d = "2"
  11.     r = -r
  12. else:
  13.     d = '3'
  14.    
  15. CPx = 150
  16. CPy = 0
  17. xS = 150
  18. yS = -100
  19. r=0.5
  20.  
  21. Xshift = ((xS-CPx)*math.cos(r*math.pi))+((CPy-yS)*math.sin(r*math.pi))
  22. Yshift = ((yS-CPy)*math.cos(r*math.pi))+((xS-CPx)*math.sin(r*math.pi))
  23. NewX = CPx + Xshift
  24. NewY = CPy + Yshift
  25. NewI = CPx - NewX
  26. NewJ = CPy - NewY
  27. print('G'+ d +' X' + str(round(NewX)) + ' Y' + str(round(NewY)) + ' I' + str(round(NewI)) + ' J' + str(round(NewJ)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top