Mercurial > hg > tony
comparison generateIcon.R @ 76:df8784695584
icons
author | matthiasm |
---|---|
date | Fri, 29 Nov 2013 14:35:39 +0000 |
parents | 279cf9b11c73 |
children | f2c853101aeb |
comparison
equal
deleted
inserted
replaced
75:279cf9b11c73 | 76:df8784695584 |
---|---|
1 t <- seq(0,8*pi,.01) | 1 t <- seq(0,8*pi,.01) |
2 w <- pnorm(t, 4*pi, 1) | 2 w <- pnorm(t, 4*pi, .7) |
3 n <- length(t) | 3 n <- length(t) |
4 pitchDiff <- 6 | 4 pitchDiff <- 6 |
5 sin1 <- sin(t) + pitchDiff | 5 sin1 <- sin(t) + pitchDiff |
6 sin2 <- sin(t) | 6 sin2 <- sin(t) |
7 | 7 |
8 lineWidth <- 15 | 8 lineWidth <- 15 |
9 outlineWidth <- 20 | 9 outlineWidth <- 20 |
10 sz <- 200 | 10 sz <- 200 |
11 | 11 |
12 png("tonyLogoWave.png", width = sz, height = sz) | 12 png("tonyLogoWave.png", width = sz, height = sz, bg="transparent") |
13 par(mar=c(0,0,0,0)) | 13 par(mar=c(0,0,0,0)) |
14 plot(t, sin1 * w + sin2 * (1-w), type='l', | 14 plot(t, sin1 * w + sin2 * (1-w), type='l', |
15 lwd=lineWidth, bty='n', xaxt='n', yaxt='n', | 15 lwd=lineWidth, bty='n', xaxt='n', yaxt='n', |
16 ylim = c(-2, pitchDiff+2) + c(1,-1)*0.1, | 16 ylim = c(-pad, pitchDiff+pad) + c(1,-1)*0.1, |
17 xlim = c(0, 8*pi) + c(1,-1)*0.1) | 17 xlim = c(0, 8*pi) + c(1,-1)*0.1) |
18 lines(c(0,0),c(-2,pitchDiff+2), lwd=outlineWidth, col = 'blue', lend=2) | 18 lines(c(0,0),c(-pad,pitchDiff+pad), lwd=outlineWidth, col = 'blue', lend=2) |
19 lines(c(0,0)+8*pi,c(-2,pitchDiff+2), lwd=outlineWidth, col = 'blue', lend=2) | 19 lines(c(0,0)+8*pi,c(-pad,pitchDiff+pad), lwd=outlineWidth, col = 'blue', lend=2) |
20 lines(c(0,8*pi),c(0,0)+pitchDiff+2, lwd=outlineWidth, col = 'blue', lend=2) | 20 lines(c(0,8*pi),c(0,0)+pitchDiff+pad, lwd=outlineWidth, col = 'blue', lend=2) |
21 lines(c(0,8*pi),c(0,0)-2, lwd=outlineWidth, col = 'blue', lend=2) | 21 lines(c(0,8*pi),c(0,0)-pad, lwd=outlineWidth, col = 'blue', lend=2) |
22 dev.off() | 22 dev.off() |