Example; intersection of an elipsoid and sphere:

var('x,y,z')
solve([x^2 +y^2+z^2 ==1,x^2+y^2+2*z^2 ==1],[x,y,z])
#[[x == r1, y == -sqrt(-r1^2 + 1), z == 0], [x == r2, y == sqrt(-r2^2
+ 1), z == 0]]
var('r1')
p1=parametric_plot3d([r1,-sqrt(-r1^2 + 1),0],
(-1,1),thickness=10,color='red')
p2=parametric_plot3d([r1,sqrt(-r1^2 + 1),0],
(-1,1),thickness=10,color='red')
P=p1+p2

A = implicit_plot3d(x^2 + y^2 + z^2 == 1,
(x,-1,1),(y,-1,1),(z,-1,1),opacity=0.4)
B = implicit_plot3d(x^2 + y^2 + 2*z^2 == 1-0.01, # with -0.01 for
better look
(x,-1,1),(y,-1,1),(z,-1,1),color='orange',opacity=0.5)
show(A+B+P)

Andrzej Chrzeszczyk

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to