fork download
  1. from __future__ import division
  2. from math import *
  3.  
  4. def dist(x1,y1,x2,y2):
  5. return sqrt((x1-x2)**2+(y1-y2)**2)
  6.  
  7. def is_concurrent(a,b,c,d,e,f):
  8. af = dist(a[0],a[1],f[0],f[1])
  9. fb = dist(b[0],b[1],f[0],f[1])
  10. bd = dist(b[0],b[1],d[0],d[1])
  11. dc = dist(c[0],c[1],d[0],d[1])
  12. ce = dist(c[0],c[1],e[0],e[1])
  13. ea = dist(a[0],a[1],e[0],e[1])
  14. return (af/fb)*(bd/dc)*(ce/ea) == 1
  15.  
  16. print is_concurrent([1,2],[3,-3],[5,4],[-6,3],[2,0],[1,-3])
Success #stdin #stdout 0.01s 7852KB
stdin
Standard input is empty
stdout
False