複數的四則運算
Author: 藍邦偉  老師

$ O $

$ 複數的四則運算 $

F = (-3.0242706104667905, -1.59571277178514)
E = (3.469271502969896, 3.0029166964493763)
u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
O = (0, 0)
A = DynamicCoordinates(E, floor(x(E)), floor(y(E)))
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 = DynamicCoordinates(F, floor(x(F)), floor(y(F)))
C: A + B
D: A - B
t_A: "$A( " + (LaTeX[x(A)]) + " " + (LaTeX[If[y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A))]) + "\; i)$"
Sub: "     $ (" + (LaTeX[x(A)]) + "" + (LaTeX[If[y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A))]) + "\;i)-(" + (LaTeX[x(B)]) + "" + (LaTeX[If[y(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(B))]) + "\;i) $
$=" + (LaTeX[x(A - B)]) + "" + (LaTeX[If[y(A - B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A - B))]) + "\;i$"
t_B: "$ B(" + (LaTeX[x(B)]) + "" + (LaTeX[If[y(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(B))]) + "\;i) $"
t_C: "$ C(" + (LaTeX[x(C)]) + "" + (LaTeX[If[y(C) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(C))]) + "\;i) $"
t_D: "$ D(" + (LaTeX[x(D)]) + "" + (LaTeX[If[y(D) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(D))]) + "\;i) $"
Add: "    $( " + (LaTeX[x(A)]) + " " + (LaTeX[If[y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A))]) + "\;i)+(" + (LaTeX[x(B)]) + "" + (LaTeX[If[y(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(B))]) + "\;i)$
$=" + (LaTeX[x(A + B)]) + "" + (LaTeX[If[y(A + B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A + B))]) + "\;i$"
a: x(A)
b: y(A)
c: x(B)
d: y(B)
Division: "     $ \frac{" + (LaTeX[x(A)]) + "" + (LaTeX[If[y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A))]) + "\;i}{" + (LaTeX[x(B)]) + "" + (LaTeX[If[y(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(B))]) + "\;i} $
$=\frac{(" + (LaTeX[a]) + "" + (LaTeX[If[b < 0, "-", "+"]]) + "" + (LaTeX[abs(b)]) + "\;i)(" + (LaTeX[c]) + "" + (LaTeX[If[d < 0, "+", "-"]]) + "" + (LaTeX[abs(d)]) + "\;i)}{(" + (LaTeX[c]) + "" + (LaTeX[If[d < 0, "-", "+"]]) + "" + (LaTeX[abs(d)]) + "\;i)(" + (LaTeX[c]) + "" + (LaTeX[If[d < 0, "+", "-"]]) + "" + (LaTeX[abs(d)]) + "\;i)}$
$=\frac{(" + (LaTeX[a * c]) + "" + (LaTeX[If[b * d > 0, "+", "-"]]) + "" + (LaTeX[abs(b * d)]) + ")+(" + (LaTeX[b * c]) + "" + (LaTeX[If[a * d > 0, "-", "+"]]) + "" + (LaTeX[abs(a * d)]) + "\;i)\;i}{" + (LaTeX[c^(2)]) + "+" + (LaTeX[d^(2)]) + "}$
$=" + (LaTeX[FractionText[(a * c + b * d) / (c^(2) + d^(2))]]) + "" + (LaTeX[If[b * c - a * d < 0, "-", "+"]]) + "" + (LaTeX[FractionText[(b * c - a * d) / (c^(2) + d^(2))]]) + "\;i$"
n = 0 (slider from 0 to 4, step 1)
Times: "    $ (" + (LaTeX[x(A)]) + "" + (LaTeX[If[y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(A))]) + "\;i)(" + (LaTeX[x(B)]) + "" + (LaTeX[If[y(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(y(B))]) + "\;i) $
$=(" + (LaTeX[x(A) * x(B)]) + "" + (LaTeX[If[y(A) * y(B) < 0, "+", "-"]]) + "" + (LaTeX[abs(y(A) * y(B))]) + ")+(" + (LaTeX[y(B) * x(A)]) + "" + (LaTeX[If[x(B) * y(A) < 0, "-", "+"]]) + "" + (LaTeX[abs(x(B) * y(A))]) + ")\;i$
$=" + (LaTeX[x(A) * x(B) - y(A) * y(B)]) + "" + (LaTeX[If[x(A) * y(B) + y(A) * x(B) < 0, "-", "+"]]) + "" + (LaTeX[abs(x(A) * y(B) + y(A) * x(B))]) + "i$"