in reply to Re^7: Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
in thread Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
Here's the code I promised:
And output from a sample run with the 4A limit set manually to an arbitrary value that produces limited output:
[17:54:13.90] C:\test>979082 -LIM4A=15 R: 5 [ -18.388, -2.409, -9.308 ] [ 7.506, 282° +] S:259 angle: 32.607° [ -6.126, -0.957, 0.400 ] [ 9.944, 249° +] R: 6 [ -18.784, -3.016, -7.671 ] [ 7.821, 269° +] S:259 angle: 19.401° [ -6.126, -0.957, 0.400 ] [ 9.944, 249° +] R: 7 [ -17.107, -3.128, -6.966 ] [ 8.391, 268° +] S: 7 angle: 10.377° [ -3.823, -2.789, 0.030 ] [ 11.980, 258° +] S:255 angle: 18.214° [ -4.814, 0.899, 0.400 ] [ 8.401, 250° +] S:254 angle: 18.338° [ -4.738, 1.093, 0.400 ] [ 8.231, 250° +] S:259 angle: 18.570° [ -6.126, -0.957, 0.400 ] [ 9.944, 249° +] S:258 angle: 20.395° [ -5.825, 0.591, 0.400 ] [ 8.548, 248° +] S:257 angle: 20.599° [ -5.970, 0.493, 0.400 ] [ 8.620, 247° +] S:256 angle: 21.740° [ -5.562, 1.600, 0.400 ] [ 7.653, 246° +] S:245 angle: 25.796° [ -5.672, 3.533, 0.140 ] [ 5.782, 242° +] R:140 [ -18.510, -10.387, -3.385 ] [ 15.732, 252° +] S:259 angle: 2.897° [ -6.126, -0.957, 0.400 ] [ 9.944, 249° +] R:141 [ -17.411, -10.096, -2.922 ] [ 15.769, 252° +] S:259 angle: 2.729° [ -6.126, -0.957, 0.400 ] [ 9.944, 249° +] S:258 angle: 4.554° [ -5.825, 0.591, 0.400 ] [ 8.548, 248° +] S:257 angle: 4.758° [ -5.970, 0.493, 0.400 ] [ 8.620, 247° +] S:256 angle: 5.899° [ -5.562, 1.600, 0.400 ] [ 7.653, 246° +] [17:54:14.34] C:\test>
As you can see, the run takes around 1/2 a second to process the 146 rotation points against the 254 stop point of your sample data. The runtime will be linear in the number of points.
The output shows that rotatable point 5 [original 3D cartesian coords] [2D polar coords (radius/angle) about z-axis]
will collide with stop point 259 after being rotated 32.607°</c>
Rot point: 6 will collide with stop point 6 after being rotated 19.401°.
Rot point 7 will collide with stop point 7 after being rotated 10.377°, and stop point 245 after being rotated 334.204° the opposite way.
And so on.
|
|---|