Advertisement
Morbo

core-xy deltaxyab

May 13th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sys import argv
  2.  
  3. def deltaX(a,b):
  4.     return .5*(a+b)
  5. def deltaY(a,b):
  6.     return .5*(a-b)
  7. def deltaA(x,y):
  8.     return x+y
  9. def deltaB(x,y):
  10.     return x-y
  11.  
  12. a = int(raw_input('What is new position Delta A? '))
  13. b = int(raw_input('What is new position Delta B? '))
  14.  
  15. pos_x = deltaX(a,b)
  16. pos_y = deltaY(a,b)
  17. pos_a = deltaA(pos_x,pos_y)
  18. pos_b = deltaB(pos_x,pos_y)
  19.  
  20. print("""
  21. New Position dX = %s
  22. New Position dY = %s
  23. New Position dA = %s
  24. New Position dB = %s
  25. """ % (pos_x,pos_y,pos_a,pos_b))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement