Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

Intersection of a line and a plane

asked 12 years ago

assadabbasi gravatar image

updated 12 years ago

Hi,

I have a line described by points (1, 0, 1), (4, -2, 2) and a plane x + y + z = 6. If solve by hand I get the point of intersection as (7, -4, 3). But in sage, I don't find any intersection point. My code in sage is as follows:

P = Polyhedron(eqns=[(-6,1,1,1)])

L = [[1, 0, 1], [4, -2, 2]]

L1 = Polyhedron(L)

intersect = L1.intersection(P)

Output is "The empty polyhedron in QQ^3". Whats wrong here? my calculation by hand or my code?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

twch gravatar image

The Problem is that the way you define your line above, you only get the line segment between the two indicated points. The intersection points lies however on the line outside of this segment. So try this instead to see the difference:

P = Polyhedron(eqns=[(-6,1,1,1)])
L1 = Polyhedron([[1, 0, 1], [4, -2, 2]])
L2 = Polyhedron(vertices=[[1,0,1]], rays=[[3,-2,1],[-3,2,-1]])
print L1.intersection(P)
print L2.intersection(P).vertices()

By the way: Is there an easier way of defining a complete line as a Polyhedron?

Preview: (hide)
link
0

answered 12 years ago

assadabbasi gravatar image

Thanks for the explanation but how do we get rays=[[3,-2,1],[-3,2,-1]] ???

Preview: (hide)
link

Comments

Well its just the vector connecting your two points. You have to take both directions (plus and minus) of this vector to generate the full line.

twch gravatar imagetwch ( 12 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 2,132 times

Last updated: Feb 27 '13