math-tools/gallery/example2.typ

30 lines
598 B
Plaintext
Raw Permalink Normal View History

2024-06-24 23:15:17 +00:00
#import "/src/lib.typ": *
#let v1 = vec.vec(1, 2, 3)
#let v2 = vec.vec(4, 5, 6)
#let v3 = vec.add(v1, v2)
#let v4 = vec.sub(v1, v2)
#let d = vec.dot(v1, v2)
#let v5 = vec.cross(v1, v2)
$arrow(v_1) = #vec.display(v1) quad arrow(v_2) = #vec.display(v2)\
arrow(v_1) + arrow(v_2) = #vec.display(v3)\
arrow(v_1) - arrow(v_2) = #vec.display(v4)\
arrow(v_1) dot arrow(v_2) = #d\
arrow(v_1) times arrow(v_2) = #vec.display(v5)\
$
#let m = mat.mat(
(1, 2),
(3, 4)
)
#let v = vec.vec(
5,
6
)
#let mv = mat.mul-vec(m, v)
$M = #mat.display(m) quad V = #vec.display(v)\
M V = #vec.display(mv)$