Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
859 B
2
Indexable
Never
import math

def distance_point(point_a, point_b):
    return (math.sqrt(math.pow((point_a[0] - point_b[0]), 2) + math.pow((point_a[1] - point_b[1]), 2)))

def check_straight(point_a, point_b, point_c):
    return (distance_point(point_a, point_b) + distance_point(point_b, point_c) == distance_point(point_a, point_c))

def check_main(points_list):
    for i in range(len(points_list) - 2):
        if check_straight(points_list[0], points_list[1], points_list[2]):
            pass
        else:
            return 0
    slope = (points_list[2][1] - points_list[1][1]) / (points_list[2][0] - points_list[1][0])
    return f""
num_points = int(input("Enter no of points: "))
points = []
for _ in range(num_points):
    point_x = int(input())
    point_y = int(input())

    point = (point_x, point_y)
    points.append(point)