n21 =

Punto O

A = Intersect(xAxis, yAxis)
ControlCircunferencia = Point(Ray[A, Vector[(1, 0)]])
c = Circle(A, ControlCircunferencia)
G = Intersect(c, yAxis, 2)
g = Line(G, xAxis)
L: ((2 * x(ControlCircunferencia)), y(G))
n21 = 1.14 (slider from 1 to 3, step 0.01)
α: asind(1 / n21)
i = Segment(G, L)
texto1: "Ángulo crítico = " + α + ""
CasillaDeEntrada1 = Textfield(n21)
V = Intersect(c, xAxis, 1)
O = Point(Ray[V, Vector[(-1, 0)]])
f, l = Tangent(O, c)
E_1 = Intersect(c, l)
F_1 = Intersect(c, f)
d = CircleArc(A, E_1, F_1)
C = Point(d)
m = Segment(O, C)
incidencia: 180° - Angle[O, C, A]
refracción: asind((1 / n21 * sin(incidencia)))
A' = Rotate(A, refracción, C)
n = Line(C, A')
E = Intersect(c, n, 2)
A'_1 = Rotate(A, 180° - incidencia, E)
p = Line(E, A'_1)
A'_2 = Rotate(A, 360° - α, G)
h = Line(A'_2, G)
H = Intersect(c, h, 2)
j = Tangent(H, c)
I = Intersect(j, xAxis)
k = Segment(I, H)
q = Segment(H, G)
r = Segment(C, E)
e = Circle(E, Segment[G, L])
M' = Intersect(e, p, 2)
K = Intersect(p, xAxis)
t = Segment(K, E)
a = Segment(O, A)
D: ((2 * Distance[A, ControlCircunferencia]), 0)
F: ((-2 * Distance[A, ControlCircunferencia]), 0)
o = false
g_1 = Segment(H, A)
h_1 = Segment(A, G)
Ext: ((-2.5 * Distance[A, ControlCircunferencia]), 0)
b = Min({x(Ext), x(O), x(K)})
f_1 = Segment((b, 0), A)
u = Max((2.5 * Distance[A, ControlCircunferencia]), x(K))
i_1 = Segment(A, (u, 0))
j_1 = Segment(((-2.5 * Distance[A, ControlCircunferencia]), 0), ((2.5 * Distance[A, ControlCircunferencia]), 0))
c_1 = Circle(H, Segment[G, L])
B = Intersect(c_1, j, 1)
k_1 = Segment(H, B)
M = If((x(K) > 0) ∧ (x(K) < x(M')), K, M')
s = If(x(K) > 0, Segment[E, K], Segment[E, M'])
m_1 = Segment(E, M')