x=k

y=k

z=k

ax = 1 (slider from 0.1 to 4.1, step 0.1)
ay = 2 (slider from 0.1 to 4.1, step 0.1)
az = 1 (slider from 0.1 to 4.1, step 0.1)
nu = 1 (slider from 0 to 1, step 1)
nn = 1 (slider from 1 to 7, step 1)
ns = 1 (slider from 1 to 4, step 1)
sx = If((nn  <  7) ∧ (nn > 3), -1, 1)
sz = If(nn ≟ 2 ∨ (nn > 5), -1, 1)
sy = If(nn ≟ 3 ∨ nn ≟ 5 ∨ nn ≟ 7, -1, 1)
c: (sx * x^(2) / ax^(2)) + (sy * y^(2) / ay^(2)) + (sz * z^(2) / az^(2)) = nu
O = Intersect(xAxis, yAxis)
Ax = Point(xAxis)
Ay = Point(yAxis)
Az = Point(yAxis)
v = 4 (slider from 0 to 4, step 1)
Tex = Element({"2", "", "2", "2"}, ns)
Tey = Element({"2", "2", "", "2"}, ns)
Tez = Element({"2", "2", "2", ""}, ns)
Tsx = If(sx ≟ 1, "", "-")
Tsy = If(sy ≟ 1, "+", "-")
Tsz = If(sz ≟ 1, "+", "-")
px = OrthogonalPlane((x(Ax), 0, 0), Vector[(1, 0, 0)])
py = OrthogonalPlane((0, y(Ay), 0), Vector[(0, 1, 0)])
pz = OrthogonalPlane((0, 0, y(Az)), Vector[(0, 0, 1)])
c0x = IntersectPath(px, c)
c0y = IntersectPath(py, c)
c0z = IntersectPath(pz, c)
w11 = Surface(((ax * cos(t)) * sin(s)), ((ay * sin(t)) * sin(s)), (az * cos(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w12 = Surface((ax * cos(t) / cos(s)), (ay * sin(t) / cos(s)), (az * tan(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w13 = Surface((ax * cos(t) / cos(s)), (ay * tan(s)), (az * sin(t) / cos(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w14 = Surface((ax * tan(s)), (ay * cos(t) / cos(s)), (az * sin(t) / cos(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w15 = Surface(((ax * cos(t)) * sin(s) / cos(s)), ((ay * sin(t)) * sin(s) / cos(s)), az / cos(s), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w16 = Surface(((ax * cos(t)) * sin(s) / cos(s)), ay / cos(s), ((az * sin(t)) * sin(s) / cos(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
w17 = Surface(ax / cos(s), ((ay * cos(t)) * sin(s) / cos(s)), ((az * sin(t)) * sin(s) / cos(s)), t, 0, 6.283185307179586, s, 0, 6.283185307179586)
W01 = (0, 0, 0)
w02 = Surface(((t * ax) * cos(s)), ((t * ay) * sin(s)), (t * az), s, 0, 360*°, t, -5, 5)
w03 = Surface(((t * ax) * cos(s)), (t * ay), ((t * az) * sin(s)), s, 0, 360*°, t, -5, 5)
w04 = Surface((t * ax), ((t * ay) * cos(s)), ((t * az) * sin(s)), s, 0, 360*°, t, -5, 5)
nd = If(ns ≟ 1, nu, 0)
Tec: "\textcolor{red}{" + (LaTeX[Tsx]) + " \frac{x^" + (LaTeX[Tex]) + "}{" + (LaTeX[ax]) + "^2}}
\textcolor{green}{" + (LaTeX[Tsy]) + "  \frac{y^" + (LaTeX[Tey]) + " }{ " + (LaTeX[ay]) + "^2}}
\textcolor{blue}{" + (LaTeX[Tsz]) + "  \frac{z^" + (LaTeX[Tez]) + " }{ " + (LaTeX[az]) + "^2}} = \textcolor{maroon}{  " + (LaTeX[nd]) + "}"
c2: (sx * x / ax^(2)) + (sy * y^(2) / ay^(2)) + (sz * z^(2) / az^(2)) = nd
c2x = IntersectPath(px, c2)
c2y = IntersectPath(py, c2)
c2z = IntersectPath(pz, c2)
w21 = Surface(((-ax^(2)) * t), ((ay * sqrt(t)) * sin(s)), ((az * sqrt(t)) * cos(s)), s, 0, 360*°, t, -5, 5)
w22 = Surface((ax^(2) * t), ((ay * sqrt(t)) * sin(s) / cos(s)), (az * sqrt(t) / cos(s)), s, 0, 360*°, t, 0, 5)
w22b = Surface(((-ax^(2)) * t), (ay * sqrt(t) / cos(s)), ((az * sqrt(t)) * sin(s) / cos(s)), s, 0, 360*°, t, 0, 5)
w23 = Surface((ax^(2) * t), (ay * sqrt(t) / cos(s)), ((az * sqrt(t)) * sin(s) / cos(s)), s, 0, 360*°, t, 0, 5)
w23b = Surface(((-ax^(2)) * t), ((ay * sqrt(t)) * sin(s) / cos(s)), (az * sqrt(t) / cos(s)), s, 0, 360*°, t, 0, 5)
w24 = Surface((ax^(2) * t), ((ay * sqrt(t)) * cos(s)), ((az * sqrt(t)) * sin(s)), s, 0, 360*°, t, 0, 6.28)
c3: (sx * x^(2) / ax^(2)) + (sy * y / ay^(2)) + (sz * z^(2) / az^(2)) = nd
c3x = IntersectPath(px, c3)
c3y = IntersectPath(py, c3)
c3z = IntersectPath(pz, c3)
w31 = Surface(((ax * sqrt(t)) * cos(s)), ((-ay^(2)) * t), ((az * sqrt(t)) * sin(s)), s, 0, 360*°, t, 0, 6.3)
w32 = Surface(((ax * sqrt(t)) * sin(s) / cos(s)), (ay^(2) * t), (az * sqrt(t) / cos(s)), s, 0, 360*°, t, 0, 5)
w32b = Surface((ax * sqrt(t) / cos(s)), ((-ay^(2)) * t), ((az * sqrt(t)) * sin(s) / cos(s)), s, 0, 360*°, t, 0, 5)
w33 = Surface(((ax * sqrt(t)) * cos(s)), (ay^(2) * t), ((az * sqrt(t)) * sin(s)), s, 0, 360*°, t, 0, 6.3)
w34 = Surface((ax * sqrt(t) / cos(s)), (ay^(2) * t), ((az * sqrt(t)) * sin(s) / cos(s)), s, 0, 360*°, t, 0, 5)
w34b = Surface(((ax * sqrt(t)) * sin(s) / cos(s)), ((-ay^(2)) * t), (az * sqrt(t) / cos(s)), s, 0, 360*°, t, 0, 5)
c4: (sx * x^(2) / ax^(2)) + (sy * y^(2) / ay^(2)) + (sz * z / az^(2)) = nd
c4x = IntersectPath(px, c4)
c4y = IntersectPath(py, c4)
c4z = IntersectPath(pz, c4)
w41 = Surface(((ax * sqrt(t)) * cos(s)), ((ay * sqrt(t)) * sin(s)), ((-az^(2)) * t), s, 0, 360*°, t, 0, 6.28)
w42 = Surface(((ax * sqrt(t)) * cos(s)), ((ay * sqrt(t)) * sin(s)), (az^(2) * t), s, 0, 360*°, t, 0, 6.28)
w43 = Surface(((ax * sqrt(t)) * sin(s) / cos(s)), (ay * sqrt(t) / cos(s)), (az^(2) * t), s, 0, 360*°, t, 0, 6.3)
w43b = Surface((ax * sqrt(t) / cos(s)), ((ay * sqrt(t)) * sin(s) / cos(s)), ((-az^(2)) * t), s, 0, 360*°, t, 0, 6.3)
w44 = Surface((ax * sqrt(t) / cos(s)), ((ay * sqrt(t)) * sin(s) / cos(s)), (az^(2) * t), s, 0, 360*°, t, 0, 6.3)
w44b = Surface(((ax * sqrt(t)) * sin(s) / cos(s)), (ay * sqrt(t) / cos(s)), ((-az^(2)) * t), s, 0, 360*°, t, 0, 6.3)