In the table below, you are given six points in 3D space, and you are told that they lie on a circular cylinder whose axis intersects the x y plane at ( x 0 , y 0 ) . Find a unit vector u = ( u x , u y , u z ) along the cylinder axis, and the radius R of the cylinder, as well as x 0 and y 0 , and compute S = x 0 + y 0 + R + ∣ u x ∣ + ∣ u y ∣ + ∣ u z ∣ . As your answer, enter ⌊ 1 0 4 S ⌋
Point | x | y | z |
1 | 4 . 3 4 7 6 2 7 5 2 6 | 1 5 . 7 4 5 4 7 1 8 4 | − 1 . 2 8 6 2 8 2 9 6 3 |
2 | 2 . 6 9 5 1 5 7 0 0 2 | 1 8 . 7 5 8 5 2 6 9 3 | 4 . 6 9 4 7 1 5 6 2 8 |
3 | 5 . 6 3 2 7 6 6 0 0 4 | 2 0 . 5 4 1 6 7 3 9 3 | 1 0 . 6 7 5 7 1 4 2 2 |
4 | 1 1 . 3 6 5 4 6 3 8 | 2 3 . 5 7 6 0 7 5 2 4 | 1 3 . 0 2 3 0 7 2 0 3 |
5 | 1 5 . 3 0 3 1 7 0 8 5 | 2 9 . 0 9 1 6 3 8 9 8 | 1 1 . 7 3 6 7 8 9 0 7 |
6 | 1 4 . 6 5 0 7 9 8 3 7 | 3 5 . 8 3 7 1 1 0 8 1 | 1 0 . 4 5 0 5 0 6 1 1 |
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
If r = ( x , y , z ) is a point on the cylinder, then it satisfies the equation of the cylinder given by,
( r − r 0 ) T Q ( r − r 0 ) = R 2
The symmetric matrix Q = I − u u T , where u is a unit vector along the axis of the cylinder. Point r 0 = ( x 0 , y 0 , 0 ) , and R is the radius of the cylinder.
Vector u can be parameterized using two angles θ and ϕ , as follows:
u = ( sin θ cos ϕ , sin θ sin ϕ , cos θ )
Our parameter vector is therefore 5-dimensional: x = ( θ , ϕ , x 0 , y 0 , R 2 )
And for i = 1 , 2 , . . . , 6 , we want
f i = ( r i − r 0 ) T Q ( r i − r 0 ) − R 2 = 0
One possible numerical method to solve these equations is the Newton-Raphson multivariate method that requires the computation of the Jacobian of the function vector f . This can be computed exactly by explicit analytical differentiation of f i , or approximately by numerical differentiation. An initial guess of the parameter vector x 0 is made, and iteratively new approximations of the solution are obtained by the Newton-Raphson multivariate recursive formula
x k + 1 = x k − J k − 1 f k
Note that since the dimension of the unknowns vector is 5 , we have to limit the number of equations to 5 , or otherwise use the Penrose inverse J # of matrix J instead of the regular inverse; the formula for the Penrose (left) inverse is J # = ( J T J ) − 1 J T .
For this particular problem, it might be difficult to come up with a good initial guess, so an external loop to set the initial values for some of the parameters (for example, θ and ϕ is necessary. In my implementation, I used an external double loop to set the initial guess of θ 0 and ϕ 0 , so that I could guarantee the convergence of the Newton-Raphson iteration.
After a few initial guesses, the Newton-Raphson method converged to x ∗ = ( 1 . 0 8 2 1 0 4 1 3 6 , 7 . 5 9 2 1 8 2 2 4 6 , 5 , 9 , 2 2 . 5 8 1 5 0 4 )
So that the axis of the cylinder is given by
u = ( 0 . 2 2 8 5 2 3 6 5 3 , 0 . 8 5 2 8 6 1 8 8 3 , 0 . 4 6 9 4 7 1 5 6 3 )
x 0 = 5 , y 0 = 9 , R = 2 2 . 5 8 1 5 0 4 = 4 . 7 5 2
Therefore, S = 2 0 . 3 0 2 8 5 7 1 , making the answer ⌊ 1 0 4 × 2 0 . 3 0 2 8 5 7 1 ⌋ = 2 0 3 0 2 8
Problem Loading...
Note Loading...
Set Loading...
This isn't a calculus-based solution, but it does illustrate the power of another optimization method. Since the axial unit vector can be described using spherical angular parameters θ and ϕ , there are four unknown values ( x 0 , y 0 , θ , ϕ ) . Using a hill-climbing algorithm, explore the four-dimensional parameter space and search for an optimal solution in the following way:
1) On each loop iteration (over many iterations), "mutate" the four parameters. Do this by moving a very small distance in a random direction within the four-dimensional space.
2) Using the mutated parameters, create the cylinder axis. Determine the distance from each of the six points to the axis. Equation 9 from this Wolfram Mathworld page is useful for calculating the distances. Per the Wolfram convention, the axis is defined by two points on a line segment.
3) Ideally, all six distances from the points to the axis should be the same. Form a "residual" as shown below. We want this residual to be as close to zero as possible.
Residual = ∣ d 1 − d 2 ∣ + ∣ d 2 − d 3 ∣ + ∣ d 3 − d 4 ∣ + ∣ d 4 − d 5 ∣ + ∣ d 5 − d 6 ∣ + ∣ d 6 − d 1 ∣
4) If the mutated parameters give a residual smaller than the smallest residual seen thus far, store the new residual and the mutated parameters, thereby converting them into the baseline parameters upon which further mutations will take place. Eventually, the algorithm converges to the optimal solution. The cylinder radius is the common distance d = d 1 = d 2 = d 3 = d 4 = d 5 = d 6 .
Results are shown below: