2D 座標架
Author: 藍邦偉  老師

$ O $

$Q$

$P$

$Step=%v$

$ 圓的切線段長 $

$ Sol： $

$R$

$S_1$

$S_2$

u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
O = (0, 0)
Q_2: 0.67 * Corner[1] + 0.33 * Corner[2]
Q_3: (x(Q_2), y(Corner[4]))
poly1, q_1, q_2, q_4, q_3 = Polygon(Corner[1], Q_2, Q_3, Corner[4])
A_0 = (1, 2)
Q = DynamicCoordinates(A_0, floor(x(A_0)), floor(y(A_0)))
B_0 = (2.4769353657370266, 3.078354158136021)
P = DynamicCoordinates(B_0, floor(x(B_0)), floor(y(B_0)))
r = Segment(Q, P)
α = 0 rad (slider from 0*° to 6.283185307179586, step 0.1*°)
P' = Rotate(P, α, Q)
c = CircleArc(Q, P, P')
h: x(Q)
k: y(Q)
s = 0 (slider from 0 to 5, step 1)
text1: "$∵ r²=\overline{PQ}^2 =" + (LaTeX[r^(2)]) + "$"
C_1 = Circle(Q, r)
D_1 = Circle(Q, r)
R_0 = (5.89549322248411, 4.415220567772701)
R = DynamicCoordinates(R_0, floor(x(R_0)), floor(y(R_0)))
L_1, L_2 = Tangent(R, D_1)
A = Intersect(C_1, D_1, 1)
B = Intersect(C_1, D_1, 1)
C = Intersect(C_1, D_1, 1)
D = Intersect(C_1, D_1, 1)
E = Intersect(C_1, D_1, 1)
F = Intersect(C_1, D_1)
S_1 = Intersect(C_1, L_1)
S_2 = Intersect(C_1, L_2)
a = 0 (slider from 0 to 1, step 0.01)
R_1: R + a * Vector[R, S_1]
R_2: R + a * Vector[R, S_2]
w_1 = Vector(R, R_1)
w_2 = Vector(R, R_2)
R_3: R + a * Vector[R, Q]
w_3 = Vector(R, R_3)
j = 0 (slider from 0 to 1, step 0.01)
R_4: Q + j * Vector[Q, S_1]
R_5: Q + j * Vector[Q, S_2]
e_1 = Vector(Q, R_4)
e_2 = Vector(Q, R_5)
g_1 = Segment(S_1, R)
g_3 = Segment(Q, R)
g_2 = Segment(S_2, R)
b_1 = Segment(Q, S_1)
b_2 = Segment(Q, S_2)
β = Angle(R, S_1, Q)
γ = Angle(Q, S_2, R)
t_Q: "$ 試求過圓外一點R" + (LaTeX[R]) + "對圓$
$" + (LaTeX[D_1]) + "作切$
$線的切線段長 $"
text2: "$⇒\overline{QR}^2=" + (LaTeX[abs(x(R) - x(Q))]) + "^2+" + (LaTeX[abs(y(R) - y(Q))]) + "^2=" + (LaTeX[g_3^(2)]) + "$"
text3: "$⇒\overline{RS_1}^2=" + (LaTeX[g_3^(2)]) + "-" + (LaTeX[r^(2)]) + "=" + (LaTeX[g_1^(2)]) + "$"
text4: "$ ⇒\overline{RS_1}=" + (LaTeX[SurdText[g_1]]) + "$"
list = Coefficients(D_1)
f = Element(list, 3)
e = Element(list, 6)
d = Element(list, 5)
p: x(R)
q: y(R)
a1: h^(2) + k^(2) - r^(2)
text5: "$公式解$
$R(x_0,y_0)$
$C:x²+y²" + (LaTeX[If[h > 0, -2 * h + "x", If[h < 0, "+" + (-2 * h) + "x", ""]]]) + "" + (LaTeX[If[k > 0, -2 * k + "y", If[k < 0, "+" + (-2 * k) + "y", ""]]]) + "" + (LaTeX[If[a1 > 0, "+" * a1, If[a1 < 0, "-" + (-a1), ""]]]) + "=0$
$\overline{RS_1}=\sqrt{x_0^2+y_0^2+dx_0+ey_0+f}$
$ \overline{RS_1}$
$=\sqrt{" + (LaTeX[p]) + "^2+" + (LaTeX[q]) + "^2" + (LaTeX[If[d < 0, "-" * (-d), "+" * d]]) + "\cdot" + (LaTeX[p]) + "" + (LaTeX[If[e < 0, "-" * (-e), "+" * e]]) + "\cdot" + (LaTeX[q]) + "" + (LaTeX[If[f < 0, "-" * (-f), "+" * f]]) + "} $
$=" + (LaTeX[SurdText[g_1]]) + "$"