Ask Your Question

Revision history [back]

I don't know how to do exactly what you're asking for, but I came up with some other ideas that might still work for you. Basically, I tried different ways of restricting or reparametrizing the domain so that you get the part of the surface you want. Since the polynomials are quadratic, you can work with them by hand, but you could have Sage do some symbolic solving or numerical root finding if that helps.

Here's a simpler example of what I mean which gives (I think) reasonable output. Depending on your purpose, an animation might be good too!

sage: var('s t')
(s, t)
sage: p = [s^2, s^2+t^2, s^2+s*t+s+t]; q = s^2+t^2+s-t+1

sage: var('r,a')
(r, a)
sage: p_polar = [_.subs(dict(zip((s,t),(r*cos(a),r*sin(a))))) for _ in p]
sage: p_polar
[r^2*cos(a)^2,
 r^2*cos(a)^2 + r^2*sin(a)^2,
 r^2*cos(a)^2 + r^2*cos(a)*sin(a) + r*cos(a) + r*sin(a)]
sage: q_polar = q.subs(dict(zip((s,t),(r*cos(a),r*sin(a)))))
sage: q_polar
r^2*cos(a)^2 + r^2*sin(a)^2 + r*cos(a) - r*sin(a) + 1

sage: bands = [parametric_plot3d([_/q_polar for _ in p_polar],(r,i*.1,(i+1)*.1),(a,0,2*pi), points=[300,200 + i*40], opacity=1-i/15, color=hue(i/15)) for i in range(15)]
sage: sum(bands)

I don't know how to do exactly what you're asking for, but I came up with some other ideas that might still work for you. Basically, I tried different ways of restricting or reparametrizing the domain so that you get the part of the surface you want. Since the polynomials are quadratic, you can work with them by hand, but you could have Sage do some symbolic solving or numerical root finding if that helps.

Here's a simpler example of what I mean which gives (I think) reasonable output. I convert to polar coordinates and plot concentric annuli in different colors with different opacities. Depending on your purpose, an animation might be good too!

sage: var('s t')
(s, t)
sage: p = [s^2, s^2+t^2, s^2+s*t+s+t]; q = s^2+t^2+s-t+1

sage: var('r,a')
(r, a)
sage: p_polar = [_.subs(dict(zip((s,t),(r*cos(a),r*sin(a))))) for _ in p]
sage: p_polar
[r^2*cos(a)^2,
 r^2*cos(a)^2 + r^2*sin(a)^2,
 r^2*cos(a)^2 + r^2*cos(a)*sin(a) + r*cos(a) + r*sin(a)]
sage: q_polar = q.subs(dict(zip((s,t),(r*cos(a),r*sin(a)))))
sage: q_polar
r^2*cos(a)^2 + r^2*sin(a)^2 + r*cos(a) - r*sin(a) + 1

sage: bands = [parametric_plot3d([_/q_polar for _ in p_polar],(r,i*.1,(i+1)*.1),(a,0,2*pi), points=[300,200 + i*40], opacity=1-i/15, color=hue(i/15)) for i in range(15)]
sage: sum(bands)