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.)
On Wednesday, 6 February 2013 05:59:45 UTC+1, John H Palmieri wrote:
>
>
>
> On Tuesday, February 5, 2013 8:24:31 PM UTC-8, Asad Akhlaq wrote:
>>
>> 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?
>>
>
> 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
>
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.