Computer Science, asked by akankshathakre, 13 hours ago

given a set of points in a plane check weather the points lie on a straight line or not if the lie on straight line return the equation else return 0 in python

Answers

Answered by spineanshdubenorth
0

Answer:

Your answer is given below:

Explanation:

All 3 points lie on the same straight line. Formula To Calculate Slope of 2 points. Slope of points (x1, y1) and (x2, y2) = m ...

Answered by ayush7652051895sl
0

Explanation:

# Python program to check

# Python program to check# if three points are collinear

def collinear(x1, y1, x2, y2, x3, y3):

a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)

if (a == 0):

print ("Yes")

else:

print("no")

#For example

x1, x2, x3, y1, y2, y3 = 1, 1, 1, 1, 4, 5

collinear(x1, y1, x2, y2, x3, y3)

#Output = Yes

#SPJ2

Similar questions