Shakeel1979 commited on
Commit
2c1bf78
·
verified ·
1 Parent(s): a2d27ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -89,7 +89,7 @@ def format_zero(val):
89
  return val
90
 
91
  # Function to plot the triangle with all points in different colors and a legend
92
- def plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, U_x, U_y, G_x, G_y, midpoints):
93
  fig, ax = plt.subplots(figsize=(8, 6))
94
  triangle = Polygon([(x1, y1), (x2, y2), (x3, y3)], closed=True, edgecolor='b', facecolor='lightblue')
95
  ax.add_patch(triangle)
@@ -263,7 +263,7 @@ def main():
263
  st.markdown(f"Centroid: **({format_zero(G_x):.3f}, {format_zero(G_y):.3f})**")
264
 
265
  # Display triangle graph with midpoints and colored points
266
- plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, U_x, U_y, G_x, G_y, midpoints)
267
 
268
  if __name__ == "__main__":
269
  main()
 
89
  return val
90
 
91
  # Function to plot the triangle with all points in different colors and a legend
92
+ def plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, U_x, U_y, G_x, G_y, midpoints, a, b, c):
93
  fig, ax = plt.subplots(figsize=(8, 6))
94
  triangle = Polygon([(x1, y1), (x2, y2), (x3, y3)], closed=True, edgecolor='b', facecolor='lightblue')
95
  ax.add_patch(triangle)
 
263
  st.markdown(f"Centroid: **({format_zero(G_x):.3f}, {format_zero(G_y):.3f})**")
264
 
265
  # Display triangle graph with midpoints and colored points
266
+ plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, U_x, U_y, G_x, G_y, midpoints, a, b, c)
267
 
268
  if __name__ == "__main__":
269
  main()