Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def intersection(x,y,z,w,r,a,b,c):
- if (r*a)+(w*b)==0:
- return None
- else :
- t=float(-a*x-b*y-c)/(r*a+w*b)
- return (x+t*w),(y+t*r)
- print intersection(0,0,0,1,1,1,1,1)
- print intersection(1,0,0,0,1,1,0,-3)
- print intersection(0,-1,0,1,-1,1,1,1)
- print intersection(0,5,0,1,1,1,0,-1)
- print intersection(0,0,0,1,1,1,0,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement