Simulate a rotating equal triangle with sides L inside a circle of radius r . I have tried it.but my code can not display the simulation of the rotating equal triangle with sides L inside a circle of radius r .
Please help me solve this using python
Simulate a rotating equal triangle with sides L inside a circle of radius r .
I have tried it.but my code can not display the simulation of the rotating equal triangle with sides L inside a circle of radius r .
Here is my code:
import numpy as np
from matplotlib import pyplot as plt
from IPython import display
r=1.0
θa=-20; θb=70 ; θc=160
xa=r*np.cos(θa)
ya=r*np.sin(θa)
xb=r*np.cos(θb)
yb=r*np.sin(θb)
xc=r*np.cos(θc)
yc=r*np.sin(θc)
line_abx = [xa,xb]
line_aby = [ya,yb]
line_bcx = [xb,xc]
line_bcy = [yb,yc]
line_cax = [xc,xa]
line_cay = [yc,ya]
T=2*np.pi/5
tarr=np.linspace(0,10*T,150)
theta = np.linspace(0,10*T,150)
radius = 1.0
a = radius*np.cos(theta)
b = radius*np.sin(theta)
figure , axes = plt.subplots()
axes.plot(a,b,c='red')
axes.set_aspect(1)
plt.plot(0 , 0, '.')
plt.plot(xa ,ya, 'o')
plt.plot(xb ,yb, 'o')
plt.plot(xc ,yc, 'o')
plt.plot(line_abx , line_aby)
plt.plot(line_bcx , line_bcy)
plt.plot(line_cax , line_cay)
plt.show()
-can you spot the problem in my code?
The output must be similar to the diagram attached
![• First, set up an coordinate system. Choose to locate the center of the triangle in the origin.
• Set the radius of the circle that encloses the equal triangle r.
• Lable the apexes in polar coordinate form, A(r,0₁), B(r,0b),C(r,0c). Fix the polar coordinates of the sites of the apexes
symmetrically, i.e., set the values, and based on the most natural symmetrical arrangement.
• Convert the coordinates into rectanular form, i.e.,
x A = r cos(0A), YA = r sin(0)
xß = r cos((B), YB = r sin(0B),
xc = r cos(0c), yc = r sin(0c).
• Connect the pairs of apexes {A, B}, {B, C'}, {C, A} by a line. Display the triangle along with the circle that encloses them. The points
should locate exactly on the circumference of the circle.
• Choose an angular rotational speed w. Let the angles to change with time via 0(t + At) = 0(t) + wAt. Hence, simulate the rotation
of the triangle for as t evolves from say t = 0 to t = 10T, where T = 2](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F85141929-1364-48af-ade9-e42cfde750d5%2Ff1db8cb4-3cdb-4275-b870-57d7a2341fc9%2Fxfv7gx_processed.png&w=3840&q=75)
![1.00
0.75
0.50
0.25
0.00
-0.25
-0.50
-0.75
-1.00
-1.0
вс 210%
-0.5
8₁=3
0.0
360°
3
L
30%
120°
0.5
10
A triangle is a special case of polygon with
n = 3 apexes.
n = 3
05 (360)
[²=2r² + 2 r² cos
360°
O₁+1= 0₁ += -,i € [1,2,...,n - 1]
72
0₁10₁-30°.
Note that the first angle 0₁-1can be fixed at
any arbitrary value, including 0°.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F85141929-1364-48af-ade9-e42cfde750d5%2Ff1db8cb4-3cdb-4275-b870-57d7a2341fc9%2F0baobvq_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)