Let's say we define the orientation of the ellipsoid from its major axis (the largest...

Poftethef9t

Poftethef9t

Answered

2022-06-27

Let's say we define the orientation of the ellipsoid from its major axis (the largest axis of the ellipsoid). Assuming the 3 axes of the ellipsoid to be on the three coordinates with lengths of a, b and c along each axis (with a b and a c), then only a single affine transformation (to a sphere) is necessary:
[ a 0 0 0 0 b 0 0 0 0 c 0 0 0 0 1 ]
Now, if we first rotate the major axis by θ from the first axis towards the second axis, and then rotate it by ϕ from the (rotated) first axis towards the third axis, the combined affine transformation becomes:
[ a 0 0 0 0 b 0 0 0 0 c 0 0 0 0 1 ] [ c o s θ s i n θ 0 0 s i n θ c o s θ 0 0 0 0 1 0 0 0 0 1 ] [ c o s ϕ 0 s i n ϕ 0 0 1 0 0 s i n ϕ 0 c o s ϕ 0 0 0 0 1 ]
Is the multiplied matrix (from left to right) the correct affine transformation that must go into the equations in the links above?

Answer & Explanation

Christina Ward

Christina Ward

Expert

2022-06-28Added 19 answers

Let's say you have an ellipsoid centered at c with semi-principal axes r 1 , r 2 , and r 3 :
r 1 = [ r 11 r 21 r 31 ] , r 2 = [ r 12 r 22 r 32 ] , r 3 = [ r 13 r 23 r 33 ]
The surface of the ellipsoid passes through points c ± r 1 , c ± r 2 and c ± r 3 .
The semi-principal axes are all perpendicular: r 1 r 2 = 0, r 1 r 3 = 0, and r 2 r 3 = 0.
The axis-aligned bounding box for the above ellipsoid is defined by
x = c x ± r 11 2 + r 12 2 + r 13 2 y = c y ± r 21 2 + r 22 2 + r 23 2 z = c z ± r 31 2 + r 32 2 + r 33 2
Note that this applies also to the case where the homogenous transformation matrix M that transforms the unit sphere to the ellipsoid is
M = [ r 11 r 12 r 13 c x r 21 r 22 r 23 c y r 31 r 32 r 33 c z 0 0 0 1 ]
Brenden Tran

Brenden Tran

Expert

2022-06-29Added 9 answers

Here is full soluion:
We can describe the transformation of the unit sphere to the above ellipsoid using
(1) p ( u , v , w ) = p ( t ) = c + u r 1 + v r 2 + w r 3 = c + R t
where t = ( u , v , w ) fulfills
t = 1 u 2 + v 2 + w 2 = 1
on the surface of the ellipsoid, and
t < 1 u 2 + v 2 + w 2 < 1
within the ellipsoid, and matrix R has the semi-principal axes as column vectors,
R = [ r 1 r 2 r 3 ] = [ r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 ]
Essentially, we scale the unit sphere by the semi-principal axes, rotate it to the new orientation, and translate the center.
The above operation is invertible, if the ellipsoid is not degenerate; that is, if r 1 > 0, r 2 > 0, and r 3 > 0.
Since rotation matrices are orthonormal, its inverse is its transpose. To counteract the scaling, we scale by the inverses of the semi-principal axes.
The scaling vectors are now row vectors of the transformation matrix, with lengths inverse to the corresponding semi-principal axis length; i.e.
s n = ( r n r n 2 ) T , n = 1 , 2 , 3
so that
s n = r n 1 , n = 1 , 2 , 3
i.e.
s 1 = r 1 r 1 2 = [ s 11 s 12 s 13 ]
s 2 = r 2 r 2 2 = [ s 21 s 22 s 23 ]
s 3 = r 3 r 3 2 = [ s 31 s 32 s 33 ]
s i j = r j i r 1 i 2 + r 2 i 2 + r 3 i 2 , i = 1 , 2 , 3 ; j = 1 , 2 , 3
S = [ s 11 s 12 s 13 s 21 s 22 s 23 s 31 s 32 s 33 ]
Now,
(2) t ( p ) = s 1 ( p c ) + s 2 ( p c ) + s 3 ( p c ) = S ( p c )
Essentially, (1) and (2) are the inverse of each other.
If you insist on using Euler or Tait-Bryan angles or other similar angular convention, I recommend you use them to calculate the semi-principal axes r 1 , r 2 , and r 3 only, and then apply the above vector solution.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get your answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?