Primera Refracción

Segunda Refracción

n21 =

A = Point(Ray[(-1, 0), Vector[(-1, 0)]])
B = Point(Segment[((x(A) * 4 / 5), 0), (0, 0)])
l_2 = Ray(B, (1, 0))
C1 = Point(l_2)
c = Circle(C1, B)
n21 = 1.6 (slider from 1 to 3, step 0.01)
f_1, g = Tangent(A, c)
D_1 = Intersect(c, g)
E_1 = Intersect(c, f_1)
d = CircumcircleArc(D_1, B, E_1)
I = Point(d)
h = Line(A, I)
i = Segment(A, I)
C' = Mirror(C1, I)
j = Segment(C', C1)
i_1 = Angle(C', I, A)
r_1': asind((1 / n21 * sin(i_1)))
C'_1 = If(y(I) ≥ 0, Rotate[C1, r_1', I], Rotate[C1, (-r_1'), I])
k = Line(I, C'_1)
f = Intersect(k, xAxis)
l = OrthogonalLine(C1, xAxis)
F_1, G_1 = Intersect(c, l)
e = Semicircle(F_1, G_1)
m = Segment(I, f)
I' = Mirror(I, I)
f' = Mirror(f, I)
m' = Segment(I', f')
r_1 = If(x(f) ≥ x(C1), Angle[C1, I, f], Angle[C1, I, f'])
n = OrthogonalLine(C1, k)
p = OrthogonalLine(C1, h)
M = Intersect(h, p)
N = Intersect(k, n)
q = OrthogonalLine(I, h)
r = OrthogonalLine(I, k)
L = Intersect(r, xAxis)
D = Intersect(q, xAxis)
s = Segment(L, I)
t = Segment(I, D)
a = Segment(C1, M)
b = Segment(M, I)
g_1 = Segment(C1, N)
o = false
C2 = Point(Ray[C1, Vector[(-1, 0)]])
c_1 = CircleArc(C2, F_1, G_1)
H = Intersect(c_1, k, 1)
C2' = Mirror(C2, H)
h_1 = Segment(C2, C2')
i_2 = Angle(I, H, C2)
j_1 = Segment(I, H)
r_2': asind((n21 * sin(i_2)))
C2'' = If(y(I) ≥ 0, Rotate[C2', (-r_2'), H], Rotate[C2', r_2', H])
k_1 = Line(H, C2'')
F = Intersect(k_1, xAxis)
r_2 = Angle(C2'', H, C2')
l_1 = Segment(H, F)
H' = Mirror(H, H)
F' = Mirror(F, H)
m_1 = Segment(H', F')
n_1 = Segment(H, f)
p_1 = OrthogonalLine(C2, k)
q_1 = OrthogonalLine(C2, k_1)
P = Intersect(k, p_1)
Q = Intersect(k_1, q_1)
s_1 = Segment(C2, P)
t_1 = Segment(P, I)
a_1 = Segment(C2, Q)
b_1 = Segment(Q, H)
E = Intersect(c_1, xAxis, 1)
d_1 = OrthogonalLine(H, n_1)
G = Intersect(d_1, xAxis)
e_1 = OrthogonalLine(H, k_1)
K = Intersect(e_1, xAxis)
f_2 = Segment(G, H)
g_2 = Segment(K, H)
h_2 = Segment(A, f)
C: (x(C1) + Distance[A, C1], 0)
j_2 = Segment(A, C)
u = false
k_2 = Segment(A, F)
CasillaDeEntrada1 = Textfield(n21)
texto2: "i_2 = " + i_2 + "             
r_2 = " + r_2 + ""
texto1: "i_1 = " + i_1 + "           
r_1 = " + r_1 + "  "
m_2 = Segment(I, N)