- UID
- 246
- UCC
-
- 声望
-
- 好评
-
- 贡献
-
- 最后登录
- 1970-1-1
|
便民便己~
同志们添加新飞船模型,新炮塔的时候会用到的。。
用IDLE运行即可。。
语言:Python 2.7.1
dxyz是3D方位->Component方位
rdxyz是倒过来 - import math
- import cmath
- minx,miny,minz = raw_input('Insert value for min xyz: ').split(';')
- maxx,maxy,maxz = raw_input('Insert value for max xyz: ').split(';')
- while True:
- anstype = raw_input('What are you looking for?: ')
- if anstype == 'dxyz':
- while True:
- x,y,z = raw_input('Insert value for desired xyz: ').split(';')
- dx = float(x)/((float(minx)+float(maxx))/2)
- dy = float(y)/((float(miny)+float(maxy))/2)
- dz = float(z)/((float(minz)+float(maxz))/2)
-
-
- print 'dx: ', round(dx, 6)
- print 'dy: ', round(dy, 6)
- print 'dz: ', round(dz, 6)
- if anstype == 'rdxyz':
- while True:
- dx,dy,dz = raw_input('Insert value for component xyz: ').split(';')
- x = float(dx)*((float(minx)+float(maxx))/2)
- y = float(dy)*((float(miny)+float(maxy))/2)
- z = float(dz)*((float(minz)+float(maxz))/2)
- print 'rdx: ', round(x, 6)
- print 'rdy: ', round(y, 6)
- print 'rdz: ', round(z, 6)
复制代码 |
|