Advertisement
MagicWinnie

Untitled

Nov 19th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. coordinates = eval(input())
  2. for i in range(len(coordinates)):
  3.     a = coordinates[i][0][1] - coordinates[i][1][1]
  4.     b = coordinates[i][1][0] - coordinates[i][0][0]
  5.     c = coordinates[i][0][0] * coordinates[i][1][1] - coordinates[i][1][0] * coordinates[i][0][1]
  6.  
  7.     for j in range(len(coordinates)):
  8.         if coordinates[i]==coordinates[j]:
  9.             continue
  10.         a1 = coordinates[j][0][1] - coordinates[j][1][1]
  11.         b1 = coordinates[j][1][0] - coordinates[j][0][0]
  12.         c1 = coordinates[j][0][0] * coordinates[j][1][1] - coordinates[j][1][0] * coordinates[j][0][1]
  13.  
  14.         y = (a*c1 - a1*c)/(a1*b - a*b1)
  15.         x = (-b1*y-c1) / a1
  16.         print(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement