-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rainbow.py
33 lines (27 loc) · 883 Bytes
/
Rainbow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from geometry import*
mpl.rcParams["font.size"] = 14
Point.radius = 0.025
A = np.array((np.cos(np.pi/3), np.sin(np.pi/3)))
d = Drawing()
circle = Circle(ORIGIN, 1)
point_A = Point(A)
line = Line(ORIGIN, A, ls="--", color="grey")
yaxis = Line(-UP*1.5, UP*1.5, ls="-", color="black")
xaxis = Line(-RIGHT*1.5, RIGHT*1.5, ls="-", color="black")
label_phi = Label(r"$\varphi_A$", ORIGIN+0.1*UP+0.1*RIGHT)
label_A = Label('A', A+0.1*UP+0.1*LEFT)
label_xaxis = Label("x", RIGHT*1.5+0.1*UP)
label_yaxis = Label("y", UP*1.5+0.1*RIGHT)
coord_axes = Group(xaxis, yaxis, label_yaxis, label_xaxis)
d.add(circle, line, label_phi, coord_axes, point_A, label_A)
alpha = np.pi/6
S = np.array((np.cos(alpha), np.sin(alpha))) + A
point_S = Point(S)
d.add(point_S)
# d.remove(point_S)
d.show()
d.remove(point_S)
d.show()