\fgcolor{cc3300}{e2: }

\fgcolor{006699}{e1: }

\; \; \;  \fgcolor{009900}{\Rightarrow} \;\;

P1 = Point(e1)
uu1a = Direction(e1)
uu1 = If(x(uu1a) ≟ 0 ∨ floor(x(uu1a)) ≟ x(uu1a) ∧ floor(y(uu1a)) ≟ y(uu1a), uu1a, Vector[uu1a / x(uu1a)])
u1a = TextToUnicode(FractionText[y(uu1)])
u1b = Last(u1a, Length[u1a] - 6)
u1c = First(u1b, Length[u1b] - 1)
u1d = Sequence(If[Element[u1c, k] ≟ 125, k, 0], k, 1, Length[u1c])
u1e = KeepIf(x > 0, u1d)
u1g = Last(u1c, Length[u1c] - Element[u1e, 1] - 1)
u1j = Sum(Sequence[(10^(Length[u1g] - k) * (Element[u1g, k] - 48)), k, 1, Length[u1g]])
b1 = If(floor(y(uu1)) ≟ y(uu1), x(uu1), u1j)
b1S = If(b1  <  0, "-", "+")
b1F = If(abs(b1) ≟ 1, "", "" + (abs(b1)))
u1f = First(u1c, Element[u1e, 1] - 1)
test1 = If(Element[u1f, 1] ≟ 45, true, false)
u1h = If(test1, Last[u1f, Length[u1f] - 1], u1f)
u1i: (If[test1, -1, 1] * Sum[Sequence[(10^(Length[u1h] - k) * (Element[u1h, k] - 48)), k, 1, Length[u1h]]])
a1 = If(floor(y(uu1)) ≟ y(uu1), (-y(uu1)), (-u1i))
c1: (a1 * x(P1)) + (b1 * y(P1))
a1F = If(a1 ≟ 1, "", If[a1 ≟ -1, "-", a1 + ""])
P2 = Point(e2)
uu2a = Direction(e2)
uu2 = If(x(uu2a) ≟ 0 ∨ floor(x(uu2a)) ≟ x(uu2a) ∧ floor(y(uu2a)) ≟ y(uu2a), uu2a, Vector[uu2a / x(uu2a)])
u2a = TextToUnicode(FractionText[y(uu2) / x(uu2)])
u2b = Last(u2a, Length[u2a] - 6)
u2c = First(u2b, Length[u2b] - 1)
u2d = Sequence(If[Element[u2c, k] ≟ 125, k, 0], k, 1, Length[u2c])
u2e = KeepIf(x > 0, u2d)
u2g = Last(u2c, Length[u2c] - Element[u2e, 1] - 1)
u2j = Sum(Sequence[(10^(Length[u2g] - k) * (Element[u2g, k] - 48)), k, 1, Length[u2g]])
b2 = If(floor(y(uu2)) ≟ y(uu2), x(uu2), u2j)
b2S = If(b2  <  0, "-", "+")
b2F = If(abs(b2) ≟ 1, "", "" + (abs(b2)))
u2f = First(u2c, Element[u2e, 1] - 1)
u2h = If(test1, Last[u2f, Length[u2f] - 1], u2f)
test2 = If(Element[u2f, 1] ≟ 45, true, false)
u2i: (If[test2, -1, 1] * Sum[Sequence[(10^(Length[u2h] - k) * (Element[u2h, k] - 48)), k, 1, Length[u2h]]])
a2 = If(floor(y(uu2)) ≟ y(uu2), (-y(uu2)), (-u2i))
cr = If(a1 ≟ 0 ∨ a2 ≟ 0 ∨ b1 ≟ 0 ∨ b2 ≟ 0, 0, If[a1 ≟ (-a2), 1, If[b1 ≟ (-b2), 2, If[a1 ≟ a2, 3, If[b1 ≟ b2, 4, If[floor(a1 / a2) ≟ a1 / a2, 5, If[floor(b1 / b2) ≟ b1 / b2, 6, If[floor(a2 / a1) ≟ a2 / a1, 7, If[floor(b2 / b1) ≟ b2 / b1, 8, 9]]]]]]]])
k2a = If(cr  <  3, 1, If[cr  <  5, -1, If[cr ≟ 5, ((-a1)) / a2, If[cr ≟ 6, ((-b1)) / b2, If[cr ≟ 7 ∨ cr ≟ 8, 1, (-a1)]]]])
k1a = If(cr  <  7, 1, If[cr ≟ 7, ((-a2)) / a1, If[cr ≟ 8, ((-b2)) / b1, a2]])
determinado = If(Determinant[{{a1, b1}, {a2, b2}}] ≟ 0, false, true)
mcm = If(a1 ≟ 0 ∧ a2 ≟ 0, (sgn(b1) * LCM[b1, b2]), (sgn(a1) * LCM[a1, a2]))
k2b = If(a2 ≟ 0, If[sgn(b2) > 0, abs(mcm / b2), (-abs(mcm / b2))], If[sgn(a2) > 0, abs(mcm / a2), (-abs(mcm / a2))])
k1b = If(a1 ≟ 0, If[sgn(b1) > 0, abs(mcm / b1), (-abs(mcm / b1))], If[sgn(a1) > 0, abs(mcm / a1), (-abs(mcm / a1))])
k1 = If(determinado, k1a, If[abs(k1b) ≠ abs(k2b), If[sgn(k1b) ≟ -1 ∧ sgn(k2b) ≟ -1, (-k1b), k1b], abs(k1b)])
k2 = If(determinado, k2a, If[abs(k1b) ≠ abs(k2b), If[sgn(k1b) ≟ -1 ∧ sgn(k2b) ≟ -1, (-k2b), k2b], If[k1b ≟ k2b, k1, (-k1)]])
k2F = If(k2 ≠ 1, "\;\;\;  \fgcolor{009900}{.(" + k2 + ")}", "")
k1F = If(k1 ≠ 1, "\;\;\;\fgcolor{009900}{.(" + k1 + ")}", "")
c2: (a2 * x(P2)) + (b2 * y(P2))
a2F = If(a2 ≟ 1, "", If[a2 ≟ -1, "-", a2 + ""])
sustb1: "\bgcolor{ffff00}{" + (If[c1 ≟ 0, "", FractionText[c1 / b1]]) + (If[(a1 / b1 > 0) ∨ c1 ≟ 0, "", "+"]) + (If[((-a1)) / b1 ≟ 1, "\;", If[((-a1)) / b1 ≟ -1, "-\;", If[((-a1)) / b1  <  0, "\;-\;", ""] + (FractionText[abs(a1) / abs(b1)]) + "\;"]]) + "x}"
A = Intersect(e1, e2)
aproX = If(round((100 * x(A))) / 100 ≟ x(A), false, true)
solx: "" + (LaTeX[FractionText[x(A)] + (If[aproX, "\;\approx\;" + (x(A)), If[floor(x(A)) ≟ x(A), "", "\;=\;" + (x(A))]])]) + ""
aproY = If(round((100 * y(A))) / 100 ≟ y(A), false, true)
soly: "" + (LaTeX[FractionText[y(A)] + (If[aproY, "\;\approx\;" + (y(A)), If[floor(y(A)) ≟ y(A), "", "\;=\;" + (y(A))]])]) + ""
sustb2: "\bgcolor{aaffaa}{" + (LaTeX[If[c2 ≟ 0, "", FractionText[c2 / b2]]]) + "" + (LaTeX[If[(a2 / b2 > 0) ∨ c2 ≟ 0, "", "+"]]) + "" + (LaTeX[If[((-a2)) / b2 ≟ 1, "\;", If[((-a2)) / b2 ≟ -1, "-\;", If[((-a2)) / b2  <  0, "\;-\;", ""] + (FractionText[abs(a2) / abs(b2)]) + "\;"]]]) + "x}"
susta2: "\bgcolor{aaffaa}{" + (If[c2 ≟ 0, "", FractionText[c2 / a2]]) + (If[(b2 / a2 > 0) ∨ c2 ≟ 0, "", "+"]) + (If[((-b2)) / a2 ≟ 1, "\;", If[((-b2)) / a2 ≟ -1, "-\;", If[((-b2)) / a2  <  0, "\;-\;", ""] + (FractionText[abs(b2) / abs(a2)]) + "\;"]]) + "y}"
susta1: "\bgcolor{ffff00}{" + (If[c1 ≟ 0, "", FractionText[c1 / a1]]) + (If[(b1 / a1 > 0) ∨ c1 ≟ 0, "", "+"]) + (If[((-b1)) / a1 ≟ 1, "\;", If[((-b1)) / a1 ≟ -1, "-\;", If[((-b1)) / a1  <  0, "\;-\;", ""] + (FractionText[abs(b1) / abs(a1)]) + "\;"]]) + "y}"
casosN: {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1}
casos: {a1 ≟ 1, b1 ≟ 1, a2 ≟ 1, b2 ≟ 1, a1 ≟ -1, b1 ≟ -1, a2 ≟ -1, b2 ≟ -1, floor(b1 / a1) ≟ b1 / a1 ∧ floor(c1 / a1) ≟ c1 / a1, floor(a1 / b1) ≟ a1 / b1 ∧ floor(c1 / b1) ≟ c1 / b1, floor(b2 / a2) ≟ b2 / a2 ∧ floor(c2 / a2) ≟ c2 / a2, floor(a2 / b2) ≟ a2 / b2 ∧ floor(c2 / b2) ≟ c2 / b2, floor(b1 / a1) ≟ b1 / a1, floor(a1 / b1) ≟ a1 / b1, floor(b2 / a2) ≟ b2 / a2, floor(a2 / b2) ≟ a2 / b2, true}
caso1 = Sequence(If[Element[casos, k], Element[casosN, k], 0], k, 1, 17)
caso2 = KeepIf(x > 0, caso1)
caso = Element(caso2, 1)
sib: "" + (LaTeX[sustb1]) + "\;=\;" + (LaTeX[sustb2]) + "" + (LaTeX[implica]) + "x\;=\;" + (LaTeX[solx]) + "" + (LaTeX[implica]) + "y\;=\;" + (LaTeX[soly]) + ""
sia: "" + susta1 + "\;=\;" + susta2 + implica + "y\;=\;" + soly + implica + "x\;=\;" + solx
s2b2: "" + (LaTeX[If[a1 ≟ 1, "\;", If[a1 ≟ -1, "-\;", a1 + "\;"]]]) + "x\;" + (LaTeX[If[b1  <  0, "", "+"]]) + "" + (LaTeX[If[b1 ≟ 1, "\;", If[b1 ≟ -1, "-\;", b1 + "\;"]]]) + "\left(" + (LaTeX[sustb2]) + "\right)\;=\;" + (LaTeX[c1]) + "" + (LaTeX[implica]) + "" + (LaTeX[If[a1 - (b1 * a2 / b2) ≟ 1, "\;", If[a1 - (b1 * a2 / b2) ≟ -1, "-\;", FractionText[a1 - (b1 * a2 / b2)] + "\;"]]]) + "x\;" + (LaTeX[If[c2 ≟ 0, "", If[(b1 * c2 / b2)  <  0, "", "+"] + (FractionText[(b1 * c2 / b2)])]]) + "\;=\;" + (LaTeX[c1]) + "" + (LaTeX[implica]) + "x\;=\;" + (LaTeX[solx]) + "" + (LaTeX[implica]) + "y\;=\;" + (LaTeX[soly]) + ""
s2a2: "" + (LaTeX[If[a1 ≟ 1, "\;", If[a1 ≟ -1, "-\;", a1 + "\;"]]]) + "\; \left(" + (LaTeX[susta2]) + "\right)" + (LaTeX[If[b1  <  0, "", "+"]]) + "" + (LaTeX[If[b1 ≟ 1, "\;", If[b1 ≟ -1, "-\;", b1 + "\;"]]]) + "y\;=\;" + (LaTeX[c1]) + "" + (LaTeX[implica]) + "" + (LaTeX[If[c2 ≟ 0, "", FractionText[(a1 * c2 / a2)]]]) + "" + (LaTeX[If[b1 - (a1 * b2 / a2)  <  0, "", "+"]]) + "" + (LaTeX[If[b1 - (a1 * b2 / a2) ≟ 1, "\;", If[b1 - (a1 * b2 / a2) ≟ -1, "-\;", FractionText[b1 - (a1 * b2 / a2)] + "\;"]]]) + "y\;=\;" + (LaTeX[c1]) + "" + (LaTeX[implica]) + "y\;=\;" + (LaTeX[soly]) + "" + (LaTeX[implica]) + "x\;=\;" + (LaTeX[solx]) + ""
s2b1: "" + (LaTeX[If[a2 ≟ 1, "\;", If[a2 ≟ -1, "-\;", a2 + "\;"]]]) + "x\;" + (LaTeX[If[b2  <  0, "", "+"]]) + "" + (LaTeX[If[b2 ≟ 1, "\;", If[b2 ≟ -1, "-\;", b2 + "\;"]]]) + "\left(" + (LaTeX[sustb1]) + "\right)\;=\;" + (LaTeX[c2]) + "" + (LaTeX[implica]) + "" + (LaTeX[If[a2 - (b2 * a1 / b1) ≟ 1, "\;", If[a2 - (b2 * a1 / b1) ≟ -1, "-\;", FractionText[a2 - (b2 * a1 / b1)] + "\;"]]]) + "x\;" + (LaTeX[If[c1 ≟ 0, "", If[(b2 * c1 / b1)  <  0, "", "+"] + (FractionText[(b2 * c1 / b1)])]]) + "\;=\;" + (LaTeX[c2]) + "" + (LaTeX[implica]) + "x\;=\;" + (LaTeX[solx]) + "" + (LaTeX[implica]) + "y\;=\;" + (LaTeX[soly]) + ""
s2a1: "" + (LaTeX[If[a2 ≟ 1, "\;", If[a2 ≟ -1, "-\;", a2 + "\;"]]]) + "\; \left(" + (LaTeX[susta1]) + "\right)" + (LaTeX[If[b2  <  0, "", "+"]]) + "" + (LaTeX[If[b2 ≟ 1, "\;", If[b2 ≟ -1, "-\;", b2 + "\;"]]]) + "y\;=\;" + (LaTeX[c2]) + "" + (LaTeX[implica]) + "" + (LaTeX[If[c1 ≟ 0, "", FractionText[(a2 * c1 / a1)]]]) + "" + (LaTeX[If[b2 - (a2 * b1 / a1)  <  0, "", "+"]]) + "" + (LaTeX[If[b2 - (a2 * b1 / a1) ≟ 1, "\;", If[b2 - (a2 * b1 / a1) ≟ -1, "-\;", FractionText[b2 - (a2 * b1 / a1)] + "\;"]]]) + "y\;=\;" + (LaTeX[c2]) + "" + (LaTeX[implica]) + "y\;=\;" + (LaTeX[soly]) + "" + (LaTeX[implica]) + "x\;=\;" + (LaTeX[solx]) + ""
a1a: (k1 * a1)
b1a: (k1 * b1)
a2a: (k2 * a2)
b2a: (k2 * b2)
a3a: a1a + a2a
u1: (b1, a1)
u2: (b2, a2)
c1a: (k1 * c1)
c2a: (k2 * c2)
b3a: b1a + b2a
c3a: c1a + c2a
t2 = If(b3a ≟ 0, "x\;=\;" + solx, "y\;=\;" + soly)
t3 = If(b3a ≟ 0, "y\;=\;" + soly, "x\;=\;" + solx)
AA: A
incompatible = If((¬determinado) ∧ ((a1a * x(P2)) + (b1a * y(P2)) ≠ c1a), true, false)
método = 1 (slider from 1 to 3, step 1)
t20b = If(a2 ≟ 0, "y\;=\;" + soly, "x\;=\;" + solx)
t30b = If(a2 ≟ 0, "x\;=\;" + solx, "y\;=\;" + soly)
t20a = If(a1 ≟ 0, "y\;=\;" + soly, "x\;=\;" + solx)
t30a = If(a1 ≟ 0, "x\;=\;" + solx, "y\;=\;" + soly)
cs = If(a1 ≟ 0 ∧ b1 ≟ 1, 1, If[a1 ≟ 0, 2, If[a1 ≟ 1 ∧ b1 ≟ 0, 3, If[b1 ≟ 0, 4, If[a2 ≟ 0 ∧ b2 ≟ 1, 5, If[a2 ≟ 0, 6, If[a2 ≟ 1 ∧ b2 ≟ 0, 7, If[b2 ≟ 0, 8, If[a1 ≟ 1, 9, If[b1 ≟ 1, 10, If[a2 ≟ 1, 11, If[b2 ≟ 1, 12, If[floor(b1 / a1) ≟ b1 / a1 ∧ floor(c1 / a1) ≟ c1 / a1, 13, If[floor(a1 / b1) ≟ a1 / b1 ∧ floor(c1 / b1) ≟ c1 / b1, 14, If[floor(b2 / a2) ≟ b2 / a2 ∧ floor(c2 / a2) ≟ c2 / a2, 15, If[floor(a2 / b2) ≟ a2 / b2 ∧ floor(c2 / b2) ≟ c2 / b2, 16, If[floor(b1 / a1) ≟ b1 / a1, 17, If[floor(a1 / b1) ≟ a1 / b1, 18, If[floor(b2 / a2) ≟ b2 / a2, 19, If[floor(a2 / b2) ≟ a2 / b2, 20, 21]]]]]]]]]]]]]]]]]]])
s2: "" + (LaTeX[If[caso ≟ 1, s2a1, If[caso ≟ 2, s2b1, If[caso ≟ 3, s2a2, s2b2]]]]) + ""
s1: "" + (LaTeX[If[caso ≟ 1, "x\;=\;" + susta1, If[caso ≟ 2, "y\;=\;" + sustb1, If[caso ≟ 3, "x\;=\;" + susta2, "y\;=\;" + sustb2]]]]) + ""
longitudCasos = Length(casos)
longitudCasosN = Length(casosN)
tmétodo: "" + (If[método ≟ 1, "Reducción", If[método ≟ 2, "Sustitución", "Igualación"]])
PP1: Corner[4] + (x(Corner[2] - Corner[1]) / 100, ((-y(Corner[4] - Corner[1]))) / 8)
PP2: Corner[1] + (x(Corner[2] - Corner[1]) / 100, y(Corner[4] - Corner[1]) / 5)
a = Segment(PP1, PP2)
E4 = 0
ss1: "" + (LaTeX[If[caso ≟ 1 ∨ caso ≟ 3, "x\;=\;" + susta1, "y\;=\;" + sustb1]]) + ""
ss2: "" + (LaTeX[If[caso ≟ 1 ∨ caso ≟ 3, "x\;=\;" + susta2, "y\;=\;" + sustb2]]) + ""
sis1 = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, k1F}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, k2F}}, "r{")
si: "" + (LaTeX[If[caso ≟ 1 ∨ caso ≟ 3, sia, sib]]) + ""
a1aF = If(a1a ≟ 1, "", If[a1a ≟ -1, "-", a1a + ""])
b1aS = If(b1a  <  0, "-", "+")
b1aF = If(abs(b1a) ≟ 1, "", "" + (abs(b1a)))
a2aF = If(a2a ≟ 1, "", If[a2a ≟ -1, "-", a2a + ""])
b2aS = If(b2a  <  0, "-", "+")
b2aF = If(abs(b2a) ≟ 1, "", "" + (abs(b2a)))
sis2 = TableText({{a1aF + " x", b1aS, b1aF + " y", "=", c1a}, {a2aF + " x", b2aS, b2aF + " y", "=", c2a}}, "r{")
a3aF = If(a3a ≟ 1, "", If[a3a ≟ -1, "-", a3a + ""])
reducirSCD: "  " + (LaTeX[sis1]) + "" + (LaTeX[If[k1 ≟ 1 ∧ k2 ≟ 1, "", implica + sis2]]) + "" + (LaTeX[implica]) + "(sumando)\;\;" + (LaTeX[a3aF + " x" + (If[b3a ≤ 0, "", "+"])]) + "" + (LaTeX[If[b3a ≟ 0, "", If[b3a ≟ 1, "\;", If[b3a ≟ -1, "-\;", b3a + "\;"]] + "y"]]) + "\;=\;" + (LaTeX[c3a]) + "" + (LaTeX[implica]) + "" + (LaTeX[t2]) + "" + (LaTeX[implica]) + "" + (LaTeX[t3]) + ""
sis1sub = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, implica, s1}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, "", ""}}, "r{")
sustituirSCD1: "" + (LaTeX[sis1sub]) + "\; \; \;\; \; " + (LaTeX[implica]) + "" + (LaTeX[s2]) + ""
sis2sub = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, "", ""}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, implica, s1}}, "r{")
sustituirSCD2: "" + (LaTeX[sis2sub]) + "\; \; \;\; \; " + (LaTeX[implica]) + "" + (LaTeX[s2]) + ""
sistemaIncompatible: "  " + (LaTeX[sis1]) + "" + (LaTeX[If[k1 ≟ 1 ∧ k2 ≟ 1, "", implica + sis2]]) + "" + (LaTeX[implica]) + "Rectas\;paralelas:\;no \;hay\; solución"
sistemaIndeterminado: "  " + (LaTeX[sis1]) + "" + (LaTeX[If[k1 ≟ 1 ∧ k2 ≟ 1, "", implica + sis2]]) + "" + (LaTeX[implica]) + "Rectas\;coincidentes:\;infinitas\; soluciones"
sisIgu = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, implica, ss1}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, implica, ss2}}, "r{")
igualarSCD: "" + (LaTeX[sisIgu]) + "\; \; \;\; \; " + (LaTeX[implica]) + "" + (LaTeX[si]) + ""
sis1red = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, implica, t20a}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, "", ""}}, "r{")
sis2red = TableText({{e1F, a1F + " x", b1S, b1F + " y", "=", c1, "", ""}, {e2F, a2F + " x", b2S, b2F + " y", "=", c2, implica, t20b}}, "r{")
reducirSCDa0: "" + (LaTeX[sis1red]) + "\; \; \;\; \; " + (LaTeX[implica]) + "" + (LaTeX[t30a]) + ""
reducirSCDb0: "" + (LaTeX[sis2red]) + "\; \; \;\; \; " + (LaTeX[implica]) + "" + (LaTeX[t30b]) + ""