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

$ O $

$ 平面向量的定義 $

$B$

$A$

$P$

$Step=%v$

$A$

$B$

$ 決定向量\overrightarrow{u}的始點\;A與終點\;B $

$ ⇒\overrightarrow{AB}=\overrightarrow{OP} $

O = (0, 0)
Q_2: 0.7 * Corner[1] + 0.3 * 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])
B_0 = (6.2201606121708535, 3.4985121725932613)
B = DynamicCoordinates(B_0, floor(x(B_0)), floor(y(B_0)))
A_0 = (4.329449547113262, 1.722389656933101)
A = DynamicCoordinates(A_0, floor(x(A_0)), floor(y(A_0)))
P: (x(B) - x(A), y(B) - y(A))
s = 0 (slider from 0 to 5, step 1)
C: A
D: B
t1 = 0 (slider from 0 to 1, step 0.01)
E: C + t1 * Vector[C, D]
u = Vector(C, E)
v = Vector(C, D)
t2 = 0 (slider from 0 to 1, step 0.01)
v'_1 = Translate(v, Vector[t2 * Vector[C, O]])
F: C + t2 * Vector[C, O]
G: D + t2 * Vector[D, P]
w = Vector(F, G)
v' = Vector(O, P)
text1: "$⇒ A" + (LaTeX[A]) + ",B" + (LaTeX[B]) + " $"
text3: "$ ⇒P" + (LaTeX[P]) + " $"
a: x(A)
b: y(A)
c: x(B)
d: y(B)
text4: "$ ⇒\overrightarrow{OP}=" + (LaTeX[P]) + "$
$=(" + (LaTeX[c]) + "" + (LaTeX[If[a < 0, "+" * (-a), "-" * a]]) + "," + (LaTeX[d]) + "" + (LaTeX[If[b < 0, "+" * (-b), "-" * b]]) + ")=\overrightarrow{AB} $"
poly2, c_1, f, g, d_1 = Polygon(C, F, G, D)
text5: "$ |\overrightarrow{AB}|=\sqrt{" + (LaTeX[abs(x(B) - x(A))]) + "^2+" + (LaTeX[abs(y(B) - y(A))]) + "^2} $
$\;\;\;\;\;\;\;\;\;=" + (LaTeX[SurdText[sqrt(abs(x(B) - x(A))^(2) + abs(y(B) - y(A))^(2))]]) + "$"