This commit is contained in:
Mark 2025-01-21 09:30:43 -08:00
parent 593527cb4e
commit 198f0a308d
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 54 additions and 139 deletions

View File

@ -1,4 +1,5 @@
#import "@preview/cetz:0.3.1" #import "@preview/cetz:0.3.1"
#import "handout.typ": *
// Shorthand, we'll be using these a lot. // Shorthand, we'll be using these a lot.
#let tp = sym.plus.circle #let tp = sym.plus.circle
@ -35,3 +36,34 @@
), ),
) )
} }
/// Adds extra padding to an equation.
/// Used as follows:
///
/// #eqmbox($
/// f(x) = -2(x #tp 2)(x #tp 8)
/// $)
///
/// Note that there are newlines between the $ and content,
/// this gives us display math (which is what we want when using this macro)
#let eqnbox(eqn) = {
align(
center,
box(
inset: 3mm,
eqn,
),
)
}
#let dotline(a, b) = {
cetz.draw.line(
a,
b,
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
}

View File

@ -72,36 +72,9 @@ Draw a graph of the tropical polynomial $f(x) = x^2 #tp 1x #tp 4$. \
import cetz.draw: * import cetz.draw: *
let step = 0.75 let step = 0.75
line( dotline((0, 0), (4 * step, 8 * step))
(0, 0), dotline((0, 1 * step), (7 * step, 8 * step))
(4 * step, 8 * step), dotline((0, 4 * step), (8 * step, 4 * step))
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 1 * step),
(7 * step, 8 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 4 * step),
(8 * step, 4 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line((0, 0), (1 * step, 2 * step), (3 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue) line((0, 0), (1 * step, 2 * step), (3 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue)
}) })
@ -161,35 +134,9 @@ Graph $f(x) = -2x^2 #tp x #tp 8$. \
import cetz.draw: * import cetz.draw: *
let step = 0.75 let step = 0.75
line( dotline((0, 0), (8 * step, 8 * step))
(0, 0), dotline((0.5 * step, 0), (4 * step, 8 * step))
(8 * step, 8 * step), dotline((0, 4 * step), (8 * step, 4 * step))
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0.5 * step, 0),
(4 * step, 8 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 4 * step),
(8 * step, 4 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line((0.5 * step, 0), (1 * step, 1 * step), (4 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue) line((0.5 * step, 0), (1 * step, 1 * step), (4 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue)
}) })
@ -201,23 +148,15 @@ Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$.
#solution([ #solution([
We (tropically) factor out $-2$ to get We (tropically) factor out $-2$ to get
#align( #eqnbox($
center, f(x) = -2(x^2 #tp 2x #tp 10)
box( $)
inset: 3mm,
$f(x) = -2(x^2 #tp 2x #tp 10)$,
),
)
by the same process as the previous problem, we get by the same process as the previous problem, we get
#eqnbox($
#align( f(x) = -2(x #tp 2)(x #tp 8)
center, $)
box(
inset: 3mm,
$f(x) = -2(x #tp 2)(x #tp 8)$,
),
)
]) ])
#v(1fr) #v(1fr)
@ -269,35 +208,9 @@ Graph $f(x) = 1x^2 #tp 3x #tp 5$.
import cetz.draw: * import cetz.draw: *
let step = 0.75 let step = 0.75
line( dotline((0, 1 * step), (3.5 * step, 8 * step))
(0, 1 * step), dotline((0, 5 * step), (8 * step, 5 * step))
(3.5 * step, 8 * step), dotline((0, 3 * step), (5 * step, 8 * step))
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 4 * step),
(8 * step, 4 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 3 * step),
(5 * step, 8 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line((0, 1 * step), (2 * step, 5 * step), (7.5 * step, 5 * step), stroke: 1mm + oblue) line((0, 1 * step), (2 * step, 5 * step), (7.5 * step, 5 * step), stroke: 1mm + oblue)
}) })
@ -308,13 +221,9 @@ Graph $f(x) = 1x^2 #tp 3x #tp 5$.
Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$. Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$.
#solution( #solution(
align( eqnbox($
center, f(x) = 1x^2 #tp 3 x #tp 5 = 1(x #tp 2)^2
box( $),
inset: 3mm,
$f(x) = 1x^2 #tp 3 x #tp 5 = 1(x #tp 2)^2$,
),
),
) )
#v(1fr) #v(1fr)
@ -343,35 +252,9 @@ Graph $f(x) = 2x^2 #tp 4x #tp 4$.
import cetz.draw: * import cetz.draw: *
let step = 0.75 let step = 0.75
line( dotline((0, 2 * step), (3 * step, 8 * step))
(0, 2 * step), dotline((0, 4 * step), (5 * step, 8 * step))
(3 * step, 8 * step), dotline((0, 4 * step), (8 * step, 4 * step))
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 4 * step),
(5 * step, 8 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line(
(0, 4 * step),
(8 * step, 4 * step),
stroke: (
dash: "dashed",
thickness: 0.5mm,
paint: ored,
),
)
line((0, 2 * step), (1 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue) line((0, 2 * step), (1 * step, 4 * step), (7.5 * step, 4 * step), stroke: 1mm + oblue)
}), }),