Shakeel1979 commited on
Commit
c05f8a9
·
verified ·
1 Parent(s): f69cb08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -90,8 +90,8 @@ def format_zero(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)
96
 
97
  # Define colors for different points
@@ -132,12 +132,12 @@ def plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, U_x, U_y, G_x, G_y, midpoint
132
 
133
  # Draw the inscribed circle (incircle)
134
  radius_in = calculate_radius_inscribed_circle(a, b, c)
135
- incircle = Circle((I_x, I_y), radius_in, color=incenter_color, fill=False, linestyle='--', linewidth=2, label="Inscribed Circle")
136
  ax.add_patch(incircle)
137
 
138
  # Draw the circumscribed circle (circumcircle)
139
  radius_circum = calculate_radius_circumscribed_circle(a, b, c)
140
- circumcircle = Circle((U_x, U_y), radius_circum, color=circumcenter_color, fill=False, linestyle='--', linewidth=2, label="Circumscribed Circle")
141
  ax.add_patch(circumcircle)
142
 
143
  # Add legend
@@ -176,7 +176,7 @@ def is_valid_triangle(a, b, c):
176
 
177
  # Main function to interact with the user
178
  def main():
179
- st.markdown("<h1 style='text-align: center;'>Advanced Triangle Solver</h1>", unsafe_allow_html=True)
180
 
181
  st.sidebar.header("Enter the cartesion coordinates for the three points of a triangle:")
182
 
 
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=(10, 8))
94
+ triangle = Polygon([(x1, y1), (x2, y2), (x3, y3)], closed=True, edgecolor='b', facecolor='lightblue', linewidth=2)
95
  ax.add_patch(triangle)
96
 
97
  # Define colors for different points
 
132
 
133
  # Draw the inscribed circle (incircle)
134
  radius_in = calculate_radius_inscribed_circle(a, b, c)
135
+ incircle = Circle((I_x, I_y), radius_in, color=incenter_color, fill=False, linestyle='--', linewidth=1, label="Inscribed Circle")
136
  ax.add_patch(incircle)
137
 
138
  # Draw the circumscribed circle (circumcircle)
139
  radius_circum = calculate_radius_circumscribed_circle(a, b, c)
140
+ circumcircle = Circle((U_x, U_y), radius_circum, color=circumcenter_color, fill=False, linestyle='--', linewidth=1, label="Circumscribed Circle")
141
  ax.add_patch(circumcircle)
142
 
143
  # Add legend
 
176
 
177
  # Main function to interact with the user
178
  def main():
179
+ st.markdown("<h1 style='text-align: left;'>Advanced Triangle Solver</h1>", unsafe_allow_html=True)
180
 
181
  st.sidebar.header("Enter the cartesion coordinates for the three points of a triangle:")
182