Skip to content

Instantly share code, notes, and snippets.

@itspacchu
Last active July 10, 2020 07:37
Show Gist options
  • Save itspacchu/a26e729aae87d73bdbdc2dff3f096cab to your computer and use it in GitHub Desktop.
Save itspacchu/a26e729aae87d73bdbdc2dff3f096cab to your computer and use it in GitHub Desktop.
# %%
import numpy as np
# %%
p,q=list(),list()
p0,p1,q0,q1 = list(map(int,input('').split(' ')))
p.append(p0);p.append(p1);q.append(q0);q.append(q1)
i = int(input())
arealist = []
for _ in range(i):
current_xy = list(map(float,input('').split(' ')))
arealist.append(np.linalg.det(np.array(((p[0],p[1],1),(q[0],q[1],1),(current_xy[0],current_xy[1],1)))))
if(sum(arealist)==0):
print('They\'re collinear')
else:
print('Nope they aint')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment