Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def intersection(x,y,z,w,r,a,b,c):
  2. if (r*a)+(w*b)==0:
  3. return None
  4. else :
  5. t=float(-a*x-b*y-c)/(r*a+w*b)
  6. return (x+t*w),(y+t*r)
  7.  
  8. print intersection(0,0,0,1,1,1,1,1)
  9. print intersection(1,0,0,0,1,1,0,-3)
  10. print intersection(0,-1,0,1,-1,1,1,1)
  11. print intersection(0,5,0,1,1,1,0,-1)
  12. print intersection(0,0,0,1,1,1,0,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement