Untitled
unknown
plain_text
6 months ago
1.8 kB
2
Indexable
import matplotlib.pyplot as plt import numpy as np # Set up the figure fig, ax = plt.subplots() # Draw a circle circle = plt.Circle((0, 0), 1, edgecolor='black', fill=False) ax.add_artist(circle) # Draw central angle central_angle_x = [0, np.cos(np.radians(30)), np.cos(np.radians(150))] central_angle_y = [0, np.sin(np.radians(30)), np.sin(np.radians(150))] ax.plot(central_angle_x, central_angle_y, marker='o', color='blue', label="Central Angle") # Draw inscribed angle B inscribed_angle_x = [np.cos(np.radians(210)), 0, np.cos(np.radians(330))] inscribed_angle_y = [np.sin(np.radians(210)), 1, np.sin(np.radians(330))] ax.plot(inscribed_angle_x, inscribed_angle_y, marker='o', color='green', label="Inscribed Angle B") # Points C and D on the circle ax.plot(np.cos(np.radians(45)), np.sin(np.radians(45)), 'ro', label="Point C") ax.plot(np.cos(np.radians(135)), np.sin(np.radians(135)), 'ro', label="Point D") # Points E and F outside the circle ax.plot(1.5, 1.5, 'bo', label="Point E") ax.plot(-1.5, 1.5, 'bo', label="Point F") # Intercepted arc by a central angle G arc_G_angles = np.linspace(30, 150, 100) arc_G_x = np.cos(np.radians(arc_G_angles)) arc_G_y = np.sin(np.radians(arc_G_angles)) ax.plot(arc_G_x, arc_G_y, color='blue', linestyle='--', label="Intercepted Arc by Central Angle G") # Intercepted arc by an inscribed angle H arc_H_angles = np.linspace(210, 330, 100) arc_H_x = np.cos(np.radians(arc_H_angles)) arc_H_y = np.sin(np.radians(arc_H_angles)) ax.plot(arc_H_x, arc_H_y, color='green', linestyle='--', label="Intercepted Arc by Inscribed Angle H") # Setting up the plot limits and aspect ratio ax.set_aspect('equal') ax.set_xlim(-2, 2) ax.set_ylim(-2, 2) # Hide axes ax.axis('off') # Add legend ax.legend(loc='upper right') # Display the plot plt.show()
Editor is loading...
Leave a Comment