x

y

A

v_1

v_2

P1_sub = (0.7904902528841717, -0.2301301625245283)
a22 = -2
a21 = 11.6
a12 = 0
a11 = 0.9
descrim: (a11 - a22)^(2) + ((4 * a12) * a21)
lambda1: (a11 + a22 + sqrt(descrim)) / 2
u1version2: a11 ≟ lambda1 ∧ a12 ≟ 0
mag1 = If(u1version2, sqrt((lambda1 - a22)^(2) + a21^(2)), sqrt(a12^(2) + (lambda1 - a11)^(2)))
u1: Vector[If[u1version2, (lambda1 - a22, a21), (a12, lambda1 - a11)]] / mag1
threshold = 0.01
threshold_theta: ((threshold * 2) * π)
xmin = -3.1463175408015824
xmax = 2.763109147364828
xscale: xmax - xmin
ymax = 1.622033190146347
ymin = -2.002458887925107
yscale: ymax - ymin
P2_sub = (0.8073502434352885, 0.22492721291616088)
dy = 1
dx = 1
P2closeu1: abs(Mod[atan2(y(P2_sub) / yscale,x(P2_sub) / xscale) - atan2(y(u1) / yscale,x(u1) / xscale) + π / 2, π] - π / 2) < threshold_theta
P2u1projectsub: ((P2_sub * u1) * u1)
P2u1projectRoundy = If(y(u1) ≟ 0, (0, 0), (((round(y(P2u1projectsub) / dy) * dy / y(u1)) * x(u1)), (round(y(P2u1projectsub) / dy) * dy)))
P2u1projectRoundx = If(x(u1) ≟ 0, (0, 0), ((round(x(P2u1projectsub) / dx) * dx), ((round(x(P2u1projectsub) / dx) * dx / x(u1)) * y(u1))))
P2u1project = If(Distance[P2u1projectsub, P2u1projectRoundx] < (0.1 * dx), P2u1projectRoundx, If[Distance[P2u1projectsub, P2u1projectRoundy] < (0.1 * dy), P2u1projectRoundy, P2u1projectsub])
lambda2: (a11 + a22 - sqrt(descrim)) / 2
u2version2: a11 ≟ lambda2 ∧ a12 ≟ 0
mag2 = If(u2version2, sqrt((lambda2 - a22)^(2) + a21^(2)), sqrt(a12^(2) + (lambda2 - a11)^(2)))
u2: Vector[If[u2version2, (lambda2 - a22, a21), (a12, lambda2 - a11)]] / mag2
P2closeu2: abs(Mod[atan2(y(P2_sub) / yscale,x(P2_sub) / xscale) - atan2(y(u2) / yscale,x(u2) / xscale) + π / 2, π] - π / 2) < threshold_theta
P2u2projectsub: ((P2_sub * u2) * u2)
P2u2projectRoundy = If(y(u2) ≟ 0, (0, 0), (((round(y(P2u2projectsub) / dy) * dy / y(u2)) * x(u2)), (round(y(P2u2projectsub) / dy) * dy)))
P2u2projectRoundx = If(x(u2) ≟ 0, (0, 0), ((round(x(P2u2projectsub) / dx) * dx), ((round(x(P2u2projectsub) / dx) * dx / x(u2)) * y(u2))))
P2u2project = If(Distance[P2u2projectsub, P2u2projectRoundx] < (0.1 * dx), P2u2projectRoundx, If[Distance[P2u2projectsub, P2u2projectRoundy] < (0.1 * dy), P2u2projectRoundy, P2u2projectsub])
P1u2projectsub: ((P1_sub * u2) * u2)
P1u1projectsub: ((P1_sub * u1) * u1)
P1closeu2: abs(Mod[atan2(y(P1_sub) / yscale,x(P1_sub) / xscale) - atan2(y(u2) / yscale,x(u2) / xscale) + π / 2, π] - π / 2) < threshold_theta
P1u2projectRoundx = If(x(u2) ≟ 0, (0, 0), ((round(x(P1u2projectsub) / dx) * dx), ((round(x(P1u2projectsub) / dx) * dx / x(u2)) * y(u2))))
P1u1projectRoundx = If(x(u1) ≟ 0, (0, 0), ((round(x(P1u1projectsub) / dx) * dx), ((round(x(P1u1projectsub) / dx) * dx / x(u1)) * y(u1))))
P1u2projectRoundy = If(y(u2) ≟ 0, (0, 0), (((round(y(P1u2projectsub) / dy) * dy / y(u2)) * x(u2)), (round(y(P1u2projectsub) / dy) * dy)))
P1u2project = If(Distance[P1u2projectsub, P1u2projectRoundx] < (0.1 * dx), P1u2projectRoundx, If[Distance[P1u2projectsub, P1u2projectRoundy] < (0.1 * dy), P1u2projectRoundy, P1u2projectsub])
P1u1projectRoundy = If(y(u1) ≟ 0, (0, 0), (((round(y(P1u1projectsub) / dy) * dy / y(u1)) * x(u1)), (round(y(P1u1projectsub) / dy) * dy)))
P1closeu1: abs(Mod[atan2(y(P1_sub) / yscale,x(P1_sub) / xscale) - atan2(y(u1) / yscale,x(u1) / xscale) + π / 2, π] - π / 2) < threshold_theta
P1u1project = If(Distance[P1u1projectsub, P1u1projectRoundx] < (0.1 * dx), P1u1projectRoundx, If[Distance[P1u1projectsub, P1u1projectRoundy] < (0.1 * dy), P1u1projectRoundy, P1u1projectsub])
P1 = DynamicCoordinates(P1_sub, If[P1closeu1, If[x(P1u1projectsub) > xmax, xmax, If[x(P1u1projectsub) < xmin, xmin, x(P1u1project)]], If[P1closeu2, If[x(P1u2projectsub) > xmax, xmax, If[x(P1u2projectsub) < xmin, xmin, x(P1u2project)]], If[x(P1_sub) > xmax, xmax, If[x(P1_sub) < xmin, xmin, x(P1_sub)]]]], If[P1closeu1, If[y(P1u1projectsub) > ymax, ymax, If[y(P1u1projectsub) < ymin, ymin, y(P1u1project)]], If[P1closeu2, If[y(P1u2projectsub) > ymax, ymax, If[y(P1u2projectsub) < ymin, ymin, y(P1u2project)]], If[y(P1_sub) > ymax, ymax, If[y(P1_sub) < ymin, ymin, y(P1_sub)]]]])
v1 = Vector(P1)
LL = Corner(1)
P2 = DynamicCoordinates(P2_sub, If[P2closeu1, If[x(P2u1projectsub) > xmax, xmax, If[x(P2u1projectsub) < xmin, xmin, x(P2u1project)]], If[P2closeu2, If[x(P2u2projectsub) > xmax, xmax, If[x(P2u2projectsub) < xmin, xmin, x(P2u2project)]], If[x(P2_sub) > xmax, xmax, If[x(P2_sub) < xmin, xmin, x(P2_sub)]]]], If[P2closeu1, If[y(P2u1projectsub) > ymax, ymax, If[y(P2u1projectsub) < ymin, ymin, y(P2u1project)]], If[P2closeu2, If[y(P2u2projectsub) > ymax, ymax, If[y(P2u2projectsub) < ymin, ymin, y(P2u2project)]], If[y(P2_sub) > ymax, ymax, If[y(P2_sub) < ymin, ymin, y(P2_sub)]]]])
v2 = Vector(P2)
UR = Corner(3)
w1 = Vector(((a11 * x(v1)) + (a12 * y(v1)), (a21 * x(v1)) + (a22 * y(v1))))
w2 = Vector(((a11 * x(v2)) + (a12 * y(v2)), (a21 * x(v2)) + (a22 * y(v2))))
xlabeldisplayed: "" + (LaTeX[xlabel]) + ""
ylabeldisplayed: "" + (LaTeX[ylabel]) + ""
lambdaComplexReal: (a11 + a22) / 2
lambdaComplexImaginary: sqrt((-descrim)) / 2
lambdaEquationComplex: "\lambda = " + (If[descrim > 0, lambda1 + ("," * lambda2), lambdaComplexReal + "+" + lambdaComplexImaginary + "i"])
v1correct: P1 ≟ P1u1project ∨ P1 ≟ P1u2project
v2correct: P2 ≟ P2u1project ∧ (P1 ≠ P1u1project) ∨ P2 ≟ P2u2project ∧ (P1 ≠ P1u2project)
Aequation: "\begin{align*}" + Aname + " = \begin{bmatrix} " + a11 + " & " + a12 + "\\ " + a21 + "&" + a22 + "\end{bmatrix}\end{align*}"
v1equation: "\mathbf{" + v1name + "} = (" + (x(v1)) + "," + (y(v1)) + ")"
v2equation: "\mathbf{" + v2name + "} = (" + (x(v2)) + "," + (y(v2)) + ")"
Av1calculation: "\begin{align*}" + Aname + " \mathbf{" + v1name + "} &= \begin{bmatrix}" + a11 + "&" + a12 + "\\" + a21 + "&" + a22 + "\end{bmatrix} \begin{bmatrix}" + (x(v1)) + "\\" + (y(v1)) + "\end{bmatrix}\\&=\begin{bmatrix}(" + a11 + ")(" + (x(v1)) + ")+(" + a12 + ")(" + (y(v1)) + ")\\(" + a21 + ")(" + (x(v1)) + ")+(" + a22 + ")(" + (y(v1)) + ")\end{bmatrix}\\&=\begin{bmatrix}" + (x(w1)) + "\\" + (y(w1)) + "\end{bmatrix}\end{align*}"
Av2calculation: "\begin{align*}" + Aname + " \mathbf{" + v2name + "} &= \begin{bmatrix}" + a11 + "&" + a12 + "\\" + a21 + "&" + a22 + "\end{bmatrix} \begin{bmatrix}" + (x(v2)) + "\\" + (y(v2)) + "\end{bmatrix}\\&=\begin{bmatrix}(" + a11 + ")(" + (x(v2)) + ")+(" + a12 + ")(" + (y(v2)) + ")\\(" + a21 + ")(" + (x(v2)) + ")+(" + a22 + ")(" + (y(v2)) + ")\end{bmatrix}\\&=\begin{bmatrix}" + (x(w2)) + "\\" + (y(w2)) + "\end{bmatrix}\end{align*}"
Av2: "" + (LaTeX[Aname]) + "\mathbf{" + (LaTeX[v2name]) + "}"
Av1: "" + (LaTeX[Aname]) + "\mathbf{" + (LaTeX[v1name]) + "}"