isjsu
unknown
java
a year ago
843 B
10
Indexable
import numpy as np
import matplotlib.pyplot as plt
def plot_problem_1():
# Circle properties
circle_center = (10, 0)
circle_radius = 6
# Set up the figure and axes
fig, ax = plt.subplots(figsize=(6, 6))
# Draw the circle
circle = plt.Circle(circle_center, circle_radius, color='blue', fill=False, linestyle='--')
ax.add_patch(circle)
# Equilateral triangle vertices (approximate placement)
triangle_points = np.array([
[10, 6],
[10 + 3*np.sqrt(3), -3],
[10 - 3*np.sqrt(3), -3]
])
ax.plot(*triangle_points[[0, 1, 2, 0]].T, color='red', marker='o')
ax.set_aspect('equal', adjustable='box')
ax.set_title('Equilateral Triangle Inscribed in a Circle')
ax.grid(True)
plt.xlim(0, 20)
plt.ylim(-10, 10)
plt.show()
plot_problem_1()
Editor is loading...
Leave a Comment