line of intersection of two planes

343 views
Skip to first unread message

Asad Akhlaq

unread,
Feb 5, 2013, 11:24:31 PM2/5/13
to sage-s...@googlegroups.com
Hi,

If anyone can help me to find the line of intersection of two planes. I can plot two planes in sage as follows:

plane1 = plot3d((6 - 3*x - 2*y)/6, (x, -5, 5), (y, -6, 6)) 
plane2 = plot3d((2 + 2*x + 9*y)/11, (x, -5, 5), (y, -6, 6)) 

plane1 + plane2  shows me the 3D graph. I can see the line of intersection of these planes. How can I get the actual values (points) of this line? Actually my main target is to find the point of intersection of two or more hyperplanes in higher dimensions (dimensions 6, 7 ,8). If anyone can just give me some hints in this regards?

Thanks

John H Palmieri

unread,
Feb 5, 2013, 11:59:45 PM2/5/13
to sage-s...@googlegroups.com

I think this should do it:

sage: var('x y z')
sage: eqn1 = (z == (6 - 3*x - 2*y)/6)
sage: eqn2 = (z == (2 + 2*x + 9*y)/11)
sage: solve([eqn1, eqn2], x, y)
[[x == -76/23*z + 58/23, y == 45/23*z - 18/23]]

--
John

Asad Akhlaq

unread,
Feb 6, 2013, 12:39:41 AM2/6/13
to sage-s...@googlegroups.com
Thank you John

LFS

unread,
Feb 6, 2013, 3:02:08 PM2/6/13
to sage-s...@googlegroups.com
Hiya John,
When I saw this I realized that Sage could parametrize the intersection of two surfaces given explicitly! Absolutely cool.
Thanks for your reply and Asad for your question.


var('x y z')
f(x,y)=(6 - 3*x - 2*y)/6
g(x,y)=(2 + 2*x + 9*y)/11

P1 = plot3d(f, (x, -5, 5), (y, -6, 6), color='red')
P2 = plot3d(g, (x, -5, 5), (y, -6, 6), color='green')

eqn1=(z==f)
eqn2=(z==g)
v=solve([eqn1,eqn2],x,y)
x_comp=v[0][0].rhs()
y_comp=v[0][1].rhs()

r=vector((x_comp,y_comp,z))
L1=parametric_plot(r,(z,-1,3), thickness=5)
show(P1+P2+L1)

(Should have substituted t for z to make it look parametric, but was so happy I got this to work.)
Reply all
Reply to author
Forward
0 new messages