Virtual_Universe

Треугольник и точки 2

Jan 11th, 2016
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (x1,y1,x2,y2,x3,y3) = map(float,input().split())
  2. def line(a1,b1,a2,b2):
  3.     if a1!=a2 and b1!=b2:
  4.         x = a1-a2
  5.         y = b1-b2
  6.         k = y/x
  7.         b = b1-a1*k
  8.         return b,k
  9.     elif a1==a2:
  10.         return a1
  11.     else:
  12.         return b1
  13.    
  14. #---------------------------
  15. def line1(z):
  16.     b = line(x1,y1,x2,y2)[0]
  17.     k = line(x1,y1,x2,y2)[1]
  18.     return (z*k+b)
  19. def line2(z):
  20.     b = line(x2,y2,x3,y3)[0]
  21.     k = line(x2,y2,x3,y3)[1]
  22.     return (z*k+b)
  23. def line3(z):
  24.     b = line(x3,y3,x1,y1)[0]
  25.     k = line(x3,y3,x1,y1)[1]
  26.     return (z*k+b)
  27. #---------------------------
  28.  
  29. if 0<=line1(0):
  30.     if 0<=line2(0):
  31.         if 0>=line3(0):
  32.             print("Yes")
  33.         else:
  34.             print("No")
  35.     else:
  36.         print("No")
  37. else:
  38.     print("No")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×