Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from math import *
- from sys import argv
- from decimal import *
- def calc():
- xa = float(argv[1])
- ya = float(argv[2])
- za = float(argv[3])
- xb = float(argv[4])
- yb = float(argv[5])
- zb = float(argv[6])
- x = float(argv[4]) - float(argv[1])
- y = float(argv[5]) - float(argv[2])
- z = float(argv[6]) - float(argv[3])
- Cx = xb
- Cy = yb
- Cz = zb
- print 'The speed vector coordinates are :'
- print '(%.2f;%.2f;%.2f)' %(x, y, z)
- print 'At time t+' + str(int(argv[7])) + ' ball coordinates will be:'
- for i in range(int(argv[7])):
- Cx = Cx + x
- Cy = Cy + y
- Cz = Cz + z
- print '(%.2f;%.2f;%.2f)' %(Cx, Cy, Cz)
- if argv[6] < 0:
- print 'The ball wont reach the bat.'
- if argv[6] >= 0:
- print 'The incidence angle is :'
- A = (zb - za) / sqrt(pow(xb-xa , 2) + pow(yb - ya, 2) + pow(zb - za, 2))
- A = 180 * acos(A) / pi - 90
- if A < 0:
- A = -A
- print '%.2f degres' %(A)
- calc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement