n_1

n_2

x

Figura 2

Figura 3

α

β

radiocircunferencia = 1.5 (slider from 0.1 to 5, step 0.01)
A = Intersect(xAxis, yAxis)
f = Line(A, xAxis)
c = Circle(A, radiocircunferencia)
B = Intersect(c, f, 1)
P = Point(Ray[B, Vector[(-1, 0)]])
f_1, g_1 = Tangent(P, c)
J = Intersect(c, f_1)
I = Intersect(c, g_1)
c_1 = CircleArc(A, I, J)
B_1, C_1 = Intersect(c, yAxis)
k = Circle(B, A)
d = CircumcircleArc(B_1, B, C_1)
E, H = Intersect(d, k)
p_1 = CircumcircleArc(E, B, H)
C_2 = Point(p_1)
h = Ray(A, C_2)
i_1 = Segment(P, C_2)
n_1 = 1.34 (slider from 1 to 2.5, step 0.01)
n_2 = 2.24 (slider from 1 to 2.5, step 0.01)
D = Intersect(Circle[A, (3 * radiocircunferencia)], h)
i = Angle(D, C_2, P)
A' = If(y(C_2) > 0, Rotate[A, asind((n_1 / n_2 * sin(i))), C_2], Rotate[A, (-asind((n_1 / n_2 * sin(i)))), C_2])
g = Ray(C_2, A')
S = Intersect(f, g)
j = Segment(C_2, S)
l = Segment(A, D)
F = If(x(P) < -6, (x(P) - 2, 0), (-8, 0))
G = If(x(S) > 4, (x(S) + 2, 0), (6, 0))
s = Segment(F, G)
t = OrthogonalLine(P, f)
e = OrthogonalLine(S, f)
CasillaDeEntrada1 = Textfield(n_1)
CasillaDeEntrada2 = Textfield(n_2)
M = Point(t)
u = Vector(P, M)
m = Line(M, A)
R = Intersect(e, m)
n = Segment(M, R)
v = Vector(S, R)
p = Segment(A, S)
a = false
α = Angle(M, A, P)
b = false
C = Point(c_1)
q = Segment(P, C)
r = Segment(C, S)
β = Angle(A, P, C)
γ = Angle(C, S, A)