2D 座標架
Author: 藍邦偉  老師
Date: 14 1 月 2013

$ O $

$Step=%v$

$B$

$C$

$A$

$H$

$θ$

$ 向量的正射影 $

$若\overrightarrow{AB}=\overrightarrow{a}=(x_1,y_1)，$
$\overrightarrow{AC}=\overrightarrow{b}=(x_2,y_2)，\;則$
$ \overrightarrow{a}在\overrightarrow{b}上的正射影為 $
$Proj_{\vec{b}}\vec{a}=(|\vec{a}|cosθ)\cdot\frac{\vec{b}}{|\vec{b}|}$
$\;\;\;\;\;\;\;\;\;\;\;=\frac{|\vec{a}|\fgcolor{red}{|\vec{b}|}\;cosθ}{|\vec{b}|\fgcolor{red}{^2}}\cdot \vec{b}$
$\;\;\;\;\;\;\;\;\;\;\;=\frac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\cdot\vec{b}$

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])
s = 0 (slider from 0 to 5, step 1)
t1 = 0 (slider from 0 to 1, step 0.01)
t2 = 0 (slider from 0 to 1, step 0.01)
t3 = 0 (slider from 0 to 1, step 0.01)
t4 = 0 (slider from 0 to 1, step 0.01)
t5 = 0 (slider from 0 to 1, step 0.01)
B_0 = (3, 4)
B = DynamicCoordinates(B_0, floor(x(B_0)), floor(y(B_0)))
C_0 = (6.296552201010697, 2.2380381292215366)
C = DynamicCoordinates(C_0, floor(x(C_0)), floor(y(C_0)))
A_0 = (1.636616855188625, 1.4741144665720054)
A = DynamicCoordinates(A_0, floor(x(A_0)), floor(y(A_0)))
B_1: A + t1 * Vector[A, B]
C_1: A + t1 * Vector[A, C]
u_1 = Vector(A, B_1)
u_2 = Vector(A, C_1)
L = OrthogonalLine(B, u_2)
H = Intersect(L, Line[A, C])
α = Angle(B, H, A)
β = Angle(B, A, C)
B_2: B + 3 * t2 * Vector[B, H]
v = Vector(B, B_2)
H_3: A + t3 * Vector[A, H]
w = Vector(A, H_3)
a1: x(B) - x(A)
b1: y(B) - y(A)
a2: x(C) - x(A)
b2: y(C) - y(A)
text1: "$ \vec{a}=\overrightarrow{AB}=(" + (LaTeX[a1]) + "," + (LaTeX[b1]) + ") ,$
$\vec{b}=\overrightarrow{AC}=(" + (LaTeX[a2]) + "," + (LaTeX[b2]) + ")$"
text21: "$⇒ |\vec{b}|^2=" + (LaTeX[abs(a2)]) + "^2+" + (LaTeX[abs(b2)]) + "^2 =" + (LaTeX[Segment[A, C]^(2)]) + "$"
b = Segment(C, H)
text22: "$⇒ \vec{a}\cdot\vec{b}=" + (LaTeX[a1]) + "\times" + (LaTeX[If[a2 < 0, "(-", ""]]) + "" + (LaTeX[abs(a2)]) + " " + (LaTeX[If[a2 < 0, ")", ""]]) + "+" + (LaTeX[If[b1 < 0, "(-" + (abs(b1)), "" + b1]]) + "" + (LaTeX[If[b1 < 0, ")", ""]]) + "\times" + (LaTeX[If[b2 < 0, "(-" + (abs(b2)), "" + b2]]) + "" + (LaTeX[If[b2 < 0, ")", ""]]) + "$`
$\;\;\;\;\;\;\;\;\;\;\;=" + (LaTeX[a1 * a2 + b1 * b2]) + "$"
q: (a1 * a2 + b1 * b2) / Segment[A, C]^(2)
text3: "$ ⇒Proj_{\vec{b}}\;\vec{a}=\frac{" + (LaTeX[a1 * a2 + b1 * b2]) + "}{" + (LaTeX[Segment[C, A]^(2)]) + "}\;(" + (LaTeX[a2]) + "," + (LaTeX[b2]) + ") $
$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;=(\;" + (LaTeX[FractionText[q * a2]]) + "," + (LaTeX[FractionText[q * b2]]) + "\;)$"
D = (-7.988823367329099, 2.1616457629565837)
text4: "$ \vec{a}\;在\vec{b}\;上的投影量為 |\vec{a}|cosθ$
$ |\vec{a}|cosθ=" + (LaTeX[SurdText[Segment[A, B]]]) + "\;cos" + (LaTeX[β]) + "=" + (LaTeX[cos(β) * Segment[A, B]]) + "$"
c = Segment(A, H)
text5: "$ \vec{a}\;在\vec{b}\;上的正射影長為$
$ \overline{AH}＝|\vec{a}||cosθ|$
$\;\;\;\;\;\;=" + (LaTeX[SurdText[Segment[A, B]]]) + "\cdot |cos" + (LaTeX[β]) + "|$
$\;\;\;\;\;\;=" + (LaTeX[cos(β) * Segment[A, B]]) + "$"
A_2: A + 3 * t2 * Vector[A, H]
a = Segment(A, A_2)
d: s - 0