added a program, some testing documents and math homework
This commit is contained in:
parent
fb27f2a441
commit
8dd1951e8f
4 changed files with 254 additions and 0 deletions
87
schule/mathe/tests/pinnit.typ
Normal file
87
schule/mathe/tests/pinnit.typ
Normal file
|
@ -0,0 +1,87 @@
|
|||
// Example adapted from: @Matt https://discord.com/channels/1054443721975922748/1088371919725793360/1166508915572351067
|
||||
|
||||
#import "@preview/pinit:0.2.2": *
|
||||
#set page(width: 700pt, height: auto, margin: 30pt)
|
||||
#set text(size: 20pt)
|
||||
#set math.equation(numbering: "(1)")
|
||||
|
||||
#let pinit-highlight-equation-from(
|
||||
height: 2em,
|
||||
pos: bottom,
|
||||
fill: rgb(0, 180, 255),
|
||||
highlight-pins,
|
||||
point-pin,
|
||||
body,
|
||||
) = {
|
||||
pinit-highlight(
|
||||
..highlight-pins,
|
||||
dy: -0.9em,
|
||||
fill: rgb(..fill.components().slice(0, -1), 40),
|
||||
)
|
||||
pinit-point-from(
|
||||
fill: fill,
|
||||
pin-dx: 0em,
|
||||
pin-dy: if pos == bottom {
|
||||
0.5em
|
||||
} else {
|
||||
-0.9em
|
||||
},
|
||||
body-dx: 0pt,
|
||||
body-dy: if pos == bottom {
|
||||
-1.7em
|
||||
} else {
|
||||
-1.6em
|
||||
},
|
||||
offset-dx: 0em,
|
||||
offset-dy: if pos == bottom {
|
||||
0.8em + height
|
||||
} else {
|
||||
-0.6em - height
|
||||
},
|
||||
point-pin,
|
||||
rect(
|
||||
inset: 0.5em,
|
||||
stroke: (bottom: 0.12em + fill),
|
||||
{
|
||||
set text(fill: fill)
|
||||
body
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Equation written out directly (for comparison):
|
||||
|
||||
$ (q_T^* p_T) / p_E p_E^* >= (c + q_T^* p_T^*)(1+r^*)^(2N) $
|
||||
|
||||
Laid out with pinit:
|
||||
|
||||
#v(3.5em)
|
||||
|
||||
$
|
||||
(#pin(1)q_T^* p_T#pin(2))/(#pin(3)p_E#pin(4))#pin(5)p_E^*#pin(6) >= (c + q_T^* p_T^*)(1+r^*)^(2N)
|
||||
$
|
||||
|
||||
#v(5em)
|
||||
|
||||
#pinit-highlight-equation-from(
|
||||
(1, 2, 3, 4),
|
||||
(3, 4),
|
||||
height: 3.5em,
|
||||
pos: bottom,
|
||||
fill: rgb(0, 180, 255),
|
||||
)[
|
||||
quantity of Terran goods
|
||||
]
|
||||
|
||||
#pinit-highlight-equation-from(
|
||||
(5, 6),
|
||||
(5, 6),
|
||||
height: 2.5em,
|
||||
pos: top,
|
||||
fill: rgb(150, 90, 170),
|
||||
)[
|
||||
price of Terran goods, on Trantor
|
||||
]
|
||||
|
||||
Paragraph after the equation.
|
43
schule/mathe/tests/plotting.typ
Normal file
43
schule/mathe/tests/plotting.typ
Normal file
|
@ -0,0 +1,43 @@
|
|||
#import "@preview/cetz:0.3.1"
|
||||
#import "@preview/cetz-plot:0.1.0": plot, chart
|
||||
|
||||
#cetz.canvas({
|
||||
// Your plot/chart code goes here
|
||||
plot.plot(
|
||||
size: (2, 2),
|
||||
x-tick-step: none,
|
||||
y-tick-step: none,
|
||||
{
|
||||
plot.add(((0, 0), (1, 1), (2, .5), (4, 3)))
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
#cetz.canvas({
|
||||
let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1))
|
||||
let data = plot.add(((-1, -1), (1, 1)), mark: "o")
|
||||
for name in (none, "school-book", "left", "scientific") {
|
||||
plot.plot(axis-style: name, ..opts, data, name: "plot")
|
||||
}
|
||||
})
|
||||
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
import cetz.plot: *
|
||||
|
||||
// Erstelle eine Plotumgebung
|
||||
plot.plot(
|
||||
size: (4, 4),
|
||||
x-tick-step: none,
|
||||
y-tick-step: none,
|
||||
{
|
||||
// Beispiel einer Funktionsschar (Scharparameter a):
|
||||
for a in (-2, -1, 0, 1, 2) {
|
||||
plot.add(domain: (-2 * calc.pi, 2 * calc.pi),
|
||||
t => (t, a * calc.sin(t)), // Hier f(x) = a * sin(x)
|
||||
mark: "o")
|
||||
}
|
||||
},
|
||||
)
|
||||
})
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue