summaryrefslogtreecommitdiff
path: root/share/hackvr/meshes/radial_to_cartesian.py
blob: 4f4370a6ad06eb51cef8ea0ed6d3bf0f7f1be989 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python
###
### so... instead of x,y,z then more x,y,z we take x,y,z then x,y,z rotations and a distance.
### so input would look like... 0 0 0  0 0 90 10
### and the output should be... addshape 0 2  0 0 0  0 0 10
import sys
import math
x=int(sys.argv[1]);
y=int(sys.argv[2]);
z=int(sys.argv[3]);
d=int(sys.argv[4]);
r=int(sys.argv[5]);
#print("{} {} {}\n".format(x, y, z))
x=math.sin(d * 2.0 * math.pi / 360.0)*r
y=math.cos(d * 2.0 * math.pi / 360.0)*r
print("{} {} 0".format(x,y))