plotting and some other stuff
This commit is contained in:
parent
04a3fa6163
commit
e0d007d99e
7 changed files with 134 additions and 4 deletions
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[submodule "libs/cetz-plot"]
|
||||||
|
path = libs/cetz-plot
|
||||||
|
url = https://github.com/cetz-package/cetz-plot
|
||||||
|
[submodule "libs/cetz"]
|
||||||
|
path = libs/cetz
|
||||||
|
url = https://github.com/cetz-package/cetz
|
|
@ -1,4 +1,8 @@
|
||||||
# Random Typstery
|
# Random Typstery
|
||||||
|
|
||||||
|
![Gitea Issues](https://img.shields.io/gitea/issues/open/erik/typst?gitea_url=https%3A%2F%2Fgit.grobecker.me&style=for-the-badge)
|
||||||
|
![Gitea Last Commit](https://img.shields.io/gitea/last-commit/erik/typst?gitea_url=https%3A%2F%2Fgit.grobecker.me&style=for-the-badge)
|
||||||
|
|
||||||
|
|
||||||
In diesem Projekt schreibe ich zufällige Sachen(meisten für die Schule) mit [typst](https://typst.app),\
|
In diesem Projekt schreibe ich zufällige Sachen(meisten für die Schule) mit [typst](https://typst.app),\
|
||||||
diese sind gestützt von meiner [Vorlage](./template.typ) welche ich immer weiter verbessern werde.
|
diese sind gestützt von meiner [Vorlage](./template.typ) welche ich immer weiter verbessern werde.
|
||||||
|
|
|
@ -52,7 +52,7 @@ Kritik an der Theorie der Demokratie\
|
||||||
#pagebreak()
|
#pagebreak()
|
||||||
= Programm der AFD
|
= Programm der AFD
|
||||||
|
|
||||||
#link("https://archive.is/O9chQ")[siehe hier] #footnote[_würg_] Punkt 6,7 & 8
|
#link("https://archive.is/O9chQ")[siehe hier] #footnote[_würg_] Punkt 6, 7 & 8
|
||||||
|
|
||||||
*Aufgabe:* wie hat die AFD vor Minderheiten zu marginalisieren?
|
*Aufgabe:* wie hat die AFD vor Minderheiten zu marginalisieren?
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,10 @@
|
||||||
#show link: set text(rgb("#1470da"))
|
#show link: set text(rgb("#1470da"))
|
||||||
|
|
||||||
// here are replacements for commonly used shortcuts
|
// here are replacements for commonly used shortcuts
|
||||||
#show "z.B.": text[zum Beispiel]
|
#show "z.B.": "zum Beispiel"
|
||||||
#show "zb": "zumb Beispiel"
|
#show "zb": "zum Beispiel"
|
||||||
#show "vllt": "vielleicht"
|
#show "vllt": "vielleicht"
|
||||||
#show "CO2": $"CO"_2$
|
#show "CO2": $"CO"_2$
|
||||||
|
|
||||||
#body // IMPORTANT: must be at the very bottom, ekse the body will be overwritten
|
#body // IMPORTANT: must be at the very bottom, else the body will be overwritten
|
||||||
]
|
]
|
55
testing/cetz-plot.typ
Normal file
55
testing/cetz-plot.typ
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
#import "@preview/cetz:0.2.2"
|
||||||
|
|
||||||
|
#set page(width: auto, height: auto, margin: .5cm)
|
||||||
|
|
||||||
|
#show math.equation: block.with(fill: white, inset: 1pt) //for not showing the grid on math
|
||||||
|
|
||||||
|
#cetz.canvas(length: 3cm, {
|
||||||
|
import cetz.draw: *
|
||||||
|
|
||||||
|
set-style(
|
||||||
|
mark: (fill: black, scale: 2),
|
||||||
|
stroke: (thickness: 0.4pt, cap: "round"),
|
||||||
|
angle: (
|
||||||
|
radius: 0.3,
|
||||||
|
label-radius: .22,
|
||||||
|
fill: green.lighten(80%),
|
||||||
|
stroke: (paint: green.darken(50%))
|
||||||
|
),
|
||||||
|
content: (padding: 1pt)
|
||||||
|
)
|
||||||
|
|
||||||
|
grid((-1.5, -1.5), (1.4, 1.4), step: 0.5, stroke: gray + 0.2pt)
|
||||||
|
|
||||||
|
circle((0,0), radius: 1)
|
||||||
|
|
||||||
|
line((-1.5, 0), (1.5, 0), mark: (end: "stealth"))
|
||||||
|
content((), $ x $, anchor: "west")
|
||||||
|
line((0, -1.5), (0, 1.5), mark: (end: "stealth"))
|
||||||
|
content((), $ y $, anchor: "south")
|
||||||
|
|
||||||
|
for (x, ct) in ((-1, $ -1 $), (-0.5, $ -1/2 $), (1, $ 1 $)) {
|
||||||
|
line((x, 3pt), (x, -3pt))
|
||||||
|
content((), anchor: "north", ct)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (y, ct) in ((-1, $ -1 $), (-0.5, $ -1/2 $), (0.5, $ 1/2 $), (1, $ 1 $)) {
|
||||||
|
line((3pt, y), (-3pt, y))
|
||||||
|
content((), anchor: "east", ct)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw the green angle
|
||||||
|
cetz.angle.angle((0,0), (1,0), (1, calc.tan(30deg)),
|
||||||
|
label: text(green, [#sym.alpha]))
|
||||||
|
|
||||||
|
line((0,0), (1, calc.tan(30deg)))
|
||||||
|
|
||||||
|
set-style(stroke: (thickness: 1.2pt))
|
||||||
|
|
||||||
|
line((30deg, 1), ((), "|-", (0,0)), stroke: (paint: red), name: "sin")
|
||||||
|
content(("sin.start", 50%, "sin.end"), text(red)[$ sin alpha $])
|
||||||
|
line("sin.end", (0,0), stroke: (paint: blue), name: "cos")
|
||||||
|
content(("cos.start", 50%, "cos.end"), text(blue)[$ cos alpha $], anchor: "north")
|
||||||
|
line((1, 0), (1, calc.tan(30deg)), name: "tan", stroke: (paint: orange))
|
||||||
|
content("tan.end", $ text(#orange, tan alpha) = text(#red, sin alpha) / text(#blue, cos alpha) $, anchor: "west")
|
||||||
|
})
|
BIN
testing/cetz.png
Normal file
BIN
testing/cetz.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
65
testing/cetz.typ
Normal file
65
testing/cetz.typ
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
// #import "@preview/cetz:0.2.2": canvas, plot
|
||||||
|
|
||||||
|
#set page(width: auto, height: auto, margin: .5cm)
|
||||||
|
|
||||||
|
// #let style = (stroke: black, fill: rgb(0, 0, 200, 75))
|
||||||
|
|
||||||
|
// #canvas(length: 1cm, {
|
||||||
|
// plot.plot(size: (8, 6),
|
||||||
|
// x-tick-step: none,
|
||||||
|
// x-ticks: ((-calc.pi, $-pi$), (0, $0$), (calc.pi, $pi$)),
|
||||||
|
// y-tick-step: 1,
|
||||||
|
// {
|
||||||
|
// plot.add(
|
||||||
|
// style: style,
|
||||||
|
// domain: (-calc.pi, calc.pi), calc.sin)
|
||||||
|
// plot.add(
|
||||||
|
// hypograph: true,
|
||||||
|
// style: style,
|
||||||
|
// domain: (-calc.pi, calc.pi), calc.cos)
|
||||||
|
// plot.add(
|
||||||
|
// hypograph: true,
|
||||||
|
// style: style,
|
||||||
|
// domain: (-calc.pi, calc.pi), x => calc.cos(x + calc.pi))
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// #canvas(length: 1cm, {
|
||||||
|
// plot.plot(size: (-10, 10),
|
||||||
|
// {},
|
||||||
|
// )
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
#import "@preview/cetz:0.2.2"
|
||||||
|
// #cetz.canvas({
|
||||||
|
// import cetz.draw: *
|
||||||
|
// import cetz.plot
|
||||||
|
// plot.plot(size: (2,2), x-tick-step: 2, y-tick-step: 2, x-equal: "y",
|
||||||
|
// {
|
||||||
|
// plot.add(((0,0), (1,1), (2,.5), (4,3)))
|
||||||
|
// plot.add(domain: (0, 2 * calc.pi),
|
||||||
|
// t => (calc.cos(t), calc.sin(t))
|
||||||
|
// )
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
#cetz.canvas({
|
||||||
|
import cetz.draw: *
|
||||||
|
import cetz.plot
|
||||||
|
plot.plot(size: (10, 4), x-tick-step: 2, y-tick-step: 50,
|
||||||
|
{
|
||||||
|
plot.add(domain: (-4, 4),
|
||||||
|
x => (x, calc.pow(x, 4) ),
|
||||||
|
label: $f(x)=x^4$
|
||||||
|
)
|
||||||
|
plot.add(domain: (-5, 6.34),
|
||||||
|
x => (x, calc.pow(x, 3)),
|
||||||
|
label: $f(x)=x^3$
|
||||||
|
)
|
||||||
|
plot.add(domain: (-10, 10),
|
||||||
|
x => (x, calc.pow(x, 2)),
|
||||||
|
label: $f(x) = x^2$
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in a new issue