-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.py
24 lines (19 loc) · 835 Bytes
/
functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import matplotlib.pyplot as plt
def draw_triangle(point_string: list[list[str]], list_of_points: list[list[str]]) -> plt:
"""Draws a line based on the three numbers of points in array"""
point1 = int(point_string[0].split(';')[0])
point2 = int(point_string[0].split(';')[1])
point3 = int(point_string[0].split(';')[2])
x = []
y = []
x.append(float(list_of_points[point1][0]))
y.append(float(list_of_points[point1][1]))
x.append(float(list_of_points[point2][0]))
y.append(float(list_of_points[point2][1]))
x.append(float(list_of_points[point3][0]))
y.append(float(list_of_points[point3][1]))
x.append(float(list_of_points[point1][0]))
y.append(float(list_of_points[point1][1]))
# print(point1, point2, point3)
# print(list_of_points[point1])
plt.errorbar(x, y)