Basically, I don't know whether I am missing something mathematically fundamental or I misued Mathematica's functions.
(*Roll,Pitch,Yawn*)
Rx = {{1, 0, 0}, {0, Cos[gamma], -Sin[gamma]}, {0, Sin[gamma],
Cos[gamma]}};
Ry = {{Cos[beta], 0, Sin[beta]}, {0, 1, 0}, {-Sin[beta], 0,
Cos[beta]}};
Rz = {{Cos[alpha], -Sin[alpha], 0}, {Sin[alpha], Cos[alpha], 0}, {0,
0, 1}};
R[alpha_, beta_, gamma_] = Rx.Ry.Rz;
OffsetTrans[d_, e_, f_] := {d, e, f};(*translation*)
X0[x0_, y0_, z0_] := {x0, y0, z0};
XPar[theta_, phi_, a_, b_, c_, alpha_, beta_, gamma_] =
R[alpha, beta, gamma].X0[x0, y0, z0] /. {x0 ->
a Cos[theta] Sin[phi], y0 -> b Sin[theta] Sin[phi],
z0 -> c Cos[phi]};
XParTrans[theta_, phi_, d_, e_, f_, a_, b_, c_, alpha_, beta_,
gamma_] =
OffsetTrans[d, e, f] +
XPar[theta, phi, a, b, c, alpha, beta,
gamma];(*parametric equations of arbitrary oriented and translated \
ellipsoid*)
ParametricPlot3D[
XParTrans[theta, phi, 0, 0, 0, 7, 5, 3, Pi/3, Pi/3, Pi/3], {theta, 0,
2 Pi}, {phi, 0, Pi},
PlotStyle -> Directive[Orange, Specularity[White, 40], Opacity[0.5]],
Mesh -> None]
(*Cartesian equation*)
X = {x, y, z};(*vector containing the three coordinate
axes*)
U = {Δx, Δy, Δz};(*a \
vector containing the distances that the center
of the ellipsoid is removed from the coordinate system origin {0,0,0}*)
\
V = {{1/a^2, 0, 0}, {0, 1/b^2, 0}, {0, 0, 1/
c^2}};(*a shape matrix containing the semi-axes a,b,and c*)
RotatedEllipsoid[x_, y_,
z_, Δx_, Δy_, Δz_, a_, b_,
c_, alpha_, beta_,
gamma_] = (X - U).R[alpha, beta, gamma].V.Transpose[
R[alpha, beta, gamma]].(X - U);
ContourPlot3D[
RotatedEllipsoid[x, y, z, 0, 0, 0, 7, 5, 3, Pi/3, Pi/3, Pi/3] ==
1, {x, -7, 7}, {y, -5, 5}, {z, -3, 3},
ContourStyle ->
Directive[Orange, Specularity[White, 40], Opacity[0.5]],
Mesh -> None]
Why the outputs are not the same?
Thanks.