diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-05-16 16:09:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-05-16 16:09:09 -0700 |
commit | d2bfb33071db91a5c781e6f32fe1bc3293d2123c (patch) | |
tree | f92dcc491b2294b8f5b2abf5912f430a3b60eccc /507line.mu | |
parent | 4260ec3b77740341566b7e251947d937b1b8545e (diff) | |
download | mu-d2bfb33071db91a5c781e6f32fe1bc3293d2123c.tar.gz |
animate transition from sum to filter node
Diffstat (limited to '507line.mu')
-rw-r--r-- | 507line.mu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/507line.mu b/507line.mu index b8ee5efb..fadd6639 100644 --- a/507line.mu +++ b/507line.mu @@ -93,3 +93,17 @@ fn draw-rect screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, loop } } + +# 0 <= u <= 1 +fn line-point u: float, x0: int, x1: int -> _/eax: int { + var one/eax: int <- copy 1 + var u-prime/xmm0: float <- convert one + u-prime <- subtract u + var result/xmm1: float <- convert x0 + result <- multiply u-prime + var term2/xmm2: float <- convert x1 + term2 <- multiply u + result <- add term2 + var result/eax: int <- convert result + return result +} |