In the table below, you are given eight points in 3D space, and you are told that they lie on an elliptical cylinder whose axis intersects the plane at . Find a unit vector along the cylinder axis, and a unit vector along the major axis of the cross section of the cylinder , the semi-major axis length , the semi-minor axis length of the elliptical cylinder cross section, as well as and , and compute . As your answer, enter
6.400310357 | 12.75036748 | -1.655584182 | |
2.936883025 | 1.392280411 | -6.93183533 | |
3.302528753 | 6.94949274 | 0.526455981 | |
0.629653921 | -0.698287736 | -1.931851653 | |
9.51390068 | 2.187595344 | -1.046299848 | |
3.832777524 | 1.264686937 | 3.823426729 | |
12.63551122 | 4.953021593 | 5.444678517 | |
3.550097691 | -6.16068045 | 3.191064106 |
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 ) then the equation of the cylinder is given by,
( r − r 0 ) Q ( r − r 0 ) = 1
where Q = R D R T
and the diagonal matrix D is given by
D = diag { a 2 1 , b 2 1 , 0 }
Here, a and b are the semi-major and semi-minor axes lengths of the elliptical cylinder cross section, and point r 0 = ( x 0 , y 0 , 0 ) . The matrix R = [ v , w , u ] , where u is the vector along the axis of the cylinder, and v , w are unit vectors along the major and minor axes of the cylinder.
u can be parameterized using two angles θ and ϕ , as follows:
u = ( sin θ cos ϕ , sin θ sin ϕ , cos θ )
Two unit vectors orthogonal to u , and to each other, are
u 1 = ( cos θ cos ϕ , cos θ sin ϕ , − sin θ )
and
u 2 = ( − s i n ϕ , cos ϕ , 0 )
hence, vectors v and w can be expressed as
v = c o s ψ u 1 + sin ψ u 2
w = − sin ψ u 1 + cos ψ u 2
Our parameter vector is therefore 7-dimensional: x = ( θ , ϕ , ψ , a , b , x 0 , y 0 )
And for i = 1 , 2 , . . . , 8 , we want
f i = ( r i − r 0 ) T Q ( r i − r 0 ) − 1 = 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 7 , we have to limit the number of equations to 7 , 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 ∗ = ( 0 . 7 8 5 3 9 8 1 6 3 , 5 . 2 3 5 9 8 7 7 5 6 , 2 . 0 9 4 3 9 5 1 0 2 , 7 . 5 , 3 . 5 , 6 , 3 )
So that the rotation matrix is given by
R = [ v , w , u ] = ⎝ ⎛ 0 . 5 7 3 2 2 3 3 0 5 0 . 7 3 9 1 9 8 9 2 0 . 3 5 3 5 5 3 3 9 1 − 0 . 7 3 9 1 9 8 9 2 0 . 2 8 0 3 3 0 0 8 6 0 . 6 1 2 3 7 2 4 3 6 0 . 3 5 3 5 5 3 3 9 1 − 0 . 6 1 2 3 7 2 4 3 6 0 . 7 0 7 1 0 6 7 8 1 ⎠ ⎞
Thus, the axis unit vector is u = ( 0 . 3 5 3 5 5 3 3 9 1 , − 0 . 6 1 2 3 7 2 4 3 6 , 0 . 7 0 7 1 0 6 7 8 1 )
And the unit vector along the major semi-axis is v = ( 0 . 5 7 3 2 2 3 3 0 5 , 0 . 7 3 9 1 9 8 9 2 , 0 . 3 5 3 5 5 3 3 9 1 )
Therefore, S = 23.33900822, making the answer ⌊ 1 0 5 × 2 3 . 3 3 9 0 0 8 2 2 ⌋ = 2 3 3 3 9 0 0