Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,12 +82,12 @@ def plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, Ux, Uy, G_x, G_y):
|
|
| 82 |
ax.scatter(x, y, color="red", zorder=5)
|
| 83 |
ax.text(x, y, f"{label}\n({x:.1f}, {y:.1f})", fontsize=10, ha="right", va="top", color="red")
|
| 84 |
|
| 85 |
-
padding =
|
| 86 |
ax.set_xlim([min(x1, x2, x3) - padding, max(x1, x2, x3) + padding])
|
| 87 |
ax.set_ylim([min(y1, y2, y3) - padding, max(y1, y2, y3) + padding])
|
| 88 |
ax.set_aspect('equal', adjustable='datalim')
|
| 89 |
|
| 90 |
-
ax.set_title('
|
| 91 |
ax.set_xlabel('X-axis', fontsize=12)
|
| 92 |
ax.set_ylabel('Y-axis', fontsize=12)
|
| 93 |
|
|
@@ -167,7 +167,7 @@ def main():
|
|
| 167 |
st.subheader("Other Properties:")
|
| 168 |
st.markdown(f"Area: **{area:.3f}** square units")
|
| 169 |
st.markdown(f"Perimeter: **{perimeter:.3f}** units")
|
| 170 |
-
st.markdown(f"Centroid
|
| 171 |
|
| 172 |
# Display triangle graph with incenter, circumcenter, and centroid
|
| 173 |
plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, Ux, Uy, G_x, G_y)
|
|
|
|
| 82 |
ax.scatter(x, y, color="red", zorder=5)
|
| 83 |
ax.text(x, y, f"{label}\n({x:.1f}, {y:.1f})", fontsize=10, ha="right", va="top", color="red")
|
| 84 |
|
| 85 |
+
padding = 3
|
| 86 |
ax.set_xlim([min(x1, x2, x3) - padding, max(x1, x2, x3) + padding])
|
| 87 |
ax.set_ylim([min(y1, y2, y3) - padding, max(y1, y2, y3) + padding])
|
| 88 |
ax.set_aspect('equal', adjustable='datalim')
|
| 89 |
|
| 90 |
+
ax.set_title('Solved Triangle', fontsize=18)
|
| 91 |
ax.set_xlabel('X-axis', fontsize=12)
|
| 92 |
ax.set_ylabel('Y-axis', fontsize=12)
|
| 93 |
|
|
|
|
| 167 |
st.subheader("Other Properties:")
|
| 168 |
st.markdown(f"Area: **{area:.3f}** square units")
|
| 169 |
st.markdown(f"Perimeter: **{perimeter:.3f}** units")
|
| 170 |
+
st.markdown(f"Centroid: **({G_x:.3f}, {G_y:.3f})**")
|
| 171 |
|
| 172 |
# Display triangle graph with incenter, circumcenter, and centroid
|
| 173 |
plot_triangle(x1, y1, x2, y2, x3, y3, I_x, I_y, Ux, Uy, G_x, G_y)
|