This commit is contained in:
Anish Lakhwara 2020-03-25 23:01:04 +11:00
parent 0437a53ca0
commit 90b476192e
19 changed files with 1063 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.png

72
chrome/chrome.pde Normal file
View file

@ -0,0 +1,72 @@
int numFrames = 50;
float size = 10;
twoCircle tc;
line l, l2, l3;
void setup(){
size(500,500);
tc = new twoCircle();
l = new line(250, 300);
l2 = new line(250, 200);
}
class twoCircle {
float size = 10;
int y = 250;
int x = 250;
void show(float t){
stroke(0, 30, 225);
strokeWeight(size * 1.5);
point(x, y);
stroke(255);
strokeWeight(size*0.75);
point(x, y);
size = size + 2*sin(TWO_PI*t);
}
}
class line {
float start, end, size;
line(float s, float e) {
start = s;
end = e;
size = 10;
}
float x1(float t){
return start + size*0.1;
}
float y1(float t){
return start - size*0.75;
}
float x2(float t){
return end + size*0.1 + 10*abs(cos(TWO_PI*t));
}
float y2(float t){
return end - 50 + 10*sin(TWO_PI*t) - size*0.75;
}
void show(float t) {
strokeWeight(2);
line(x1(t),y1(t),x2(t),y2(t));
size = size + 2*sin(TWO_PI*t);
}
}
void draw(){
background(0);
float t = 1.0*(frameCount-1)/numFrames;
tc.show(t);
l.show(t);
l2.show(t);
if(frameCount<=numFrames){
saveFrame("fr###.png");
}
}

View file

@ -0,0 +1,73 @@
/**
Bryn Mawr College, Department of Computer Science <br>
Classic starfield using 2D transformations and z-scaling.
*/
// Array of stars
Star[] stars = new Star[400];
void setup() {
size(600, 600);
smooth();
stroke(255);
strokeWeight(5);
// Init all stars
for (int i=0; i<stars.length; i++)
stars[i] = new Star();
}
void draw() {
background(0);
// Draw all stars wrt center of screen
translate(0.5*width, 0.5*height);
// Update and draw all stars
for (int i=0; i<stars.length; i++) {
stars[i].update();
stars[i].draw();
}
}
class Star {
// Star coordinates in 3D
float x;
float y;
float z;
Star() {
x = random(-5000, 5000);
y = random(-5000, 5000);
z = random(0, 2000);
}
void update() {
z-=10; // Move star closer to viewport
if (z <= 0.0) // Reset star if it passes viewport
reset();
}
void reset() {
// Reset star to a position far away
x = random(-5000, 5000);
y = random(-5000, 5000);
z = 2000.0;
}
void draw() {
// Project star only viewport
float offsetX = 100.0*(x/z);
float offsetY = 100.0*(y/z);
float scaleZ = 0.0001*(2000.0-z);
// Draw this star
pushMatrix();
translate(offsetX, offsetY);
scale(scaleZ);
ellipse(0,0,20,20);
popMatrix();
}
}

View file

@ -0,0 +1,64 @@
Star[] stars = new Star[400];
void setup() {
size(800,800);
smooth();
stroke(255);
strokeWeight(5);
for (int i = 0; i < stars.length; i++) {
stars[i] = new Star();
}
}
void draw() {
background(0);
translate(width/2, height/2);
for (int i = 0; i < stars.length; i++) {
stars[i].update();
stars[i].show();
}
}
class Star {
float x;
float y;
float z;
float pz;
Star() {
x = random(-width, width);
y = random(-height, height);
z = random(0, 2000);
pz = z;
}
void update() {
pz = z + 100;
z = z - 20;
if (z<1) {
z = 2000;
y = random(-height, height);
x = random(-width, width);
pz = z;
}
}
void show() {
fill(255);
noStroke();
float sx = map(x/z, 0, 1, 0, width);
float sy = map(y/z, 0, 1, 0, width);
float r = map(z-1000, 0, width, 16, 0);
ellipse(sx, sy, r, r);
float px = map(x/pz, 0, 1, 0, width);
float py = map(y/pz, 0, 1, 0, height);
stroke(255);
line(px, py, sx, sy);
}
}

BIN
lines/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

264
setSquare/.exrc Normal file
View file

@ -0,0 +1,264 @@
let s:cpo_save=&cpo
set cpo&vim
inoremap <Plug>(emmet-merge-lines) =emmet#util#closePopup() =emmet#mergeLines()
inoremap <Plug>(emmet-anchorize-summary) =emmet#util#closePopup() =emmet#anchorizeURL(1)
inoremap <Plug>(emmet-anchorize-url) =emmet#util#closePopup() =emmet#anchorizeURL(0)
inoremap <Plug>(emmet-remove-tag) =emmet#util#closePopup() =emmet#removeTag()
inoremap <Plug>(emmet-split-join-tag) :call emmet#splitJoinTag()
inoremap <Plug>(emmet-toggle-comment) =emmet#util#closePopup() =emmet#toggleComment()
inoremap <Plug>(emmet-image-encode) =emmet#util#closePopup() =emmet#imageEncode()
inoremap <Plug>(emmet-image-size) =emmet#util#closePopup() =emmet#imageSize()
inoremap <Plug>(emmet-move-prev-item) :call emmet#moveNextPrevItem(1)
inoremap <Plug>(emmet-move-next-item) :call emmet#moveNextPrevItem(0)
inoremap <Plug>(emmet-move-prev) =emmet#util#closePopup() =emmet#moveNextPrev(1)
inoremap <Plug>(emmet-move-next) =emmet#util#closePopup() =emmet#moveNextPrev(0)
inoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
inoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
inoremap <Plug>(emmet-update-tag) =emmet#util#closePopup() =emmet#updateTag()
inoremap <Plug>(emmet-expand-word) =emmet#util#closePopup() =emmet#expandAbbr(1,"")
inoremap <Plug>(emmet-expand-abbr) =emmet#util#closePopup() =emmet#expandAbbr(0,"")
inoremap <silent> <Plug>CocRefresh =coc#_complete()
inoremap <silent> <expr> <C-Space> coc#refresh()
inoremap <expr> <S-Tab> pumvisible() ? "\" : "\"
inoremap <F5> =strftime("%Y-%m-%d %H:%M:")
inoremap <M-l> l
inoremap <M-k> k
inoremap <M-j> j
inoremap <M-h> h
xmap <silent>  <Plug>(coc-range-select)
nmap <silent>  <Plug>(coc-range-select)
vmap c <Plug>(emmet-code-pretty)
nmap m <Plug>(emmet-merge-lines)
nmap A <Plug>(emmet-anchorize-summary)
nmap a <Plug>(emmet-anchorize-url)
nmap k <Plug>(emmet-remove-tag)
nmap j <Plug>(emmet-split-join-tag)
nmap / <Plug>(emmet-toggle-comment)
nmap I <Plug>(emmet-image-encode)
nmap i <Plug>(emmet-image-size)
nmap N <Plug>(emmet-move-prev)
nmap n <Plug>(emmet-move-next)
vmap D <Plug>(emmet-balance-tag-outword)
nmap D <Plug>(emmet-balance-tag-outword)
vmap d <Plug>(emmet-balance-tag-inward)
nmap d <Plug>(emmet-balance-tag-inward)
nmap u <Plug>(emmet-update-tag)
nmap ; <Plug>(emmet-expand-word)
vmap , <Plug>(emmet-expand-abbr)
nmap , <Plug>(emmet-expand-abbr)
map  ds <Plug>DrawItStop
map  di <Plug>DrawItStart
map  rwp <Plug>RestoreWinPosn
map  swp <Plug>SaveWinPosn
nmap <silent>  w m <Plug>VimwikiMakeTomorrowDiaryNote
nmap <silent>  w y <Plug>VimwikiMakeYesterdayDiaryNote
nmap <silent>  w t <Plug>VimwikiTabMakeDiaryNote
nmap <silent>  w w <Plug>VimwikiMakeDiaryNote
nmap <silent>  w i <Plug>VimwikiDiaryGenerateLinks
nmap <silent>  wi <Plug>VimwikiDiaryIndex
nmap <silent>  ws <Plug>VimwikiUISelect
nmap <silent>  wt <Plug>VimwikiTabIndex
nmap <silent>  ww <Plug>VimwikiIndex
nnoremap <silent>  p :CocListResume
nnoremap <silent>  k :CocPrev
nnoremap <silent>  j :CocNext
nnoremap <silent>  s :CocList -I symbols
nnoremap <silent>  o :CocList outline
nnoremap <silent>  c :CocList commands
nnoremap <silent>  e :CocList extensions
nmap  qf <Plug>(coc-fix-current)
nmap  ac <Plug>(coc-codeaction)
nnoremap <silent>  a :CocList diagnostics
xmap  a <Plug>(coc-codeaction-selected)
nmap  f <Plug>(coc-format-selected)
xmap  f <Plug>(coc-format-selected)
nmap  rn <Plug>(coc-rename)
map  z :NV
map  q :wq
vmap  s :w
omap  s :w
map  t :NERDTreeToggle
xmap , <Plug>Sneak_,
omap , <Plug>Sneak_,
nmap , <Plug>Sneak_,
xmap ; <Plug>Sneak_;
omap ; <Plug>Sneak_;
nmap ; <Plug>Sneak_;
nmap S <Plug>Sneak_S
xmap S <Plug>VSurround
xmap Z <Plug>Sneak_S
omap Z <Plug>Sneak_S
vmap [% [%m'gv``
nmap <silent> [g <Plug>(coc-diagnostic-prev)
vmap ]% ]%m'gv``
nmap <silent> ]g <Plug>(coc-diagnostic-next)
vmap a% [%v]%
omap af <Plug>(coc-funcobj-a)
xmap af <Plug>(coc-funcobj-a)
nmap cS <Plug>CSurround
nmap cs <Plug>Csurround
nmap ds <Plug>Dsurround
vmap gx <Plug>NetrwBrowseXVis
nmap gx <Plug>NetrwBrowseX
xmap gS <Plug>VgSurround
nmap <silent> gr <Plug>(coc-references)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gd <Plug>(coc-definition)
omap if <Plug>(coc-funcobj-i)
xmap if <Plug>(coc-funcobj-i)
xmap s <Plug>Sneak_s
nmap s <Plug>Sneak_s
nmap ySS <Plug>YSsurround
nmap ySs <Plug>YSsurround
nmap yss <Plug>Yssurround
nmap yS <Plug>YSurround
nmap ys <Plug>Ysurround
omap z <Plug>Sneak_s
vnoremap <silent> <Plug>NetrwBrowseXVis :call netrw#BrowseXVis()
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())
noremap <silent> <Plug>DrawItStop :set lz :call DrawIt#DrawItStop() :set nolz
noremap <silent> <Plug>DrawItStart :set lz :call DrawIt#DrawItStart() :set nolz
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()
omap <Plug>SneakPrevious <Plug>Sneak_,
omap <Plug>SneakNext <Plug>Sneak_;
xmap <Plug>SneakPrevious <Plug>Sneak_,
xmap <Plug>SneakNext <Plug>Sneak_;
nmap <Plug>SneakPrevious <Plug>Sneak_,
nmap <Plug>SneakNext <Plug>Sneak_;
omap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
omap <Plug>(SneakStreak) <Plug>SneakLabel_s
xmap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
xmap <Plug>(SneakStreak) <Plug>SneakLabel_s
nmap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
nmap <Plug>(SneakStreak) <Plug>SneakLabel_s
xmap <Plug>VSneakPrevious <Plug>Sneak_,
xmap <Plug>VSneakNext <Plug>Sneak_;
xmap <Plug>VSneakBackward <Plug>Sneak_S
xmap <Plug>VSneakForward <Plug>Sneak_s
nmap <Plug>SneakBackward <Plug>Sneak_S
nmap <Plug>SneakForward <Plug>Sneak_s
onoremap <silent> <Plug>SneakLabel_S :call sneak#wrap(v:operator, 2, 1, 2, 2)
onoremap <silent> <Plug>SneakLabel_s :call sneak#wrap(v:operator, 2, 0, 2, 2)
xnoremap <silent> <Plug>SneakLabel_S :call sneak#wrap(visualmode(), 2, 1, 2, 2)
xnoremap <silent> <Plug>SneakLabel_s :call sneak#wrap(visualmode(), 2, 0, 2, 2)
nnoremap <silent> <Plug>SneakLabel_S :call sneak#wrap('', 2, 1, 2, 2)
nnoremap <silent> <Plug>SneakLabel_s :call sneak#wrap('', 2, 0, 2, 2)
onoremap <silent> <Plug>Sneak_T :call sneak#wrap(v:operator, 1, 1, 0, 0)
onoremap <silent> <Plug>Sneak_t :call sneak#wrap(v:operator, 1, 0, 0, 0)
xnoremap <silent> <Plug>Sneak_T :call sneak#wrap(visualmode(), 1, 1, 0, 0)
xnoremap <silent> <Plug>Sneak_t :call sneak#wrap(visualmode(), 1, 0, 0, 0)
nnoremap <silent> <Plug>Sneak_T :call sneak#wrap('', 1, 1, 0, 0)
nnoremap <silent> <Plug>Sneak_t :call sneak#wrap('', 1, 0, 0, 0)
onoremap <silent> <Plug>Sneak_F :call sneak#wrap(v:operator, 1, 1, 1, 0)
onoremap <silent> <Plug>Sneak_f :call sneak#wrap(v:operator, 1, 0, 1, 0)
xnoremap <silent> <Plug>Sneak_F :call sneak#wrap(visualmode(), 1, 1, 1, 0)
xnoremap <silent> <Plug>Sneak_f :call sneak#wrap(visualmode(), 1, 0, 1, 0)
nnoremap <silent> <Plug>Sneak_F :call sneak#wrap('', 1, 1, 1, 0)
nnoremap <silent> <Plug>Sneak_f :call sneak#wrap('', 1, 0, 1, 0)
onoremap <silent> <Plug>SneakRepeat :call sneak#wrap(v:operator, sneak#util#getc(), sneak#util#getc(), sneak#util#getc(), sneak#util#getc())
onoremap <silent> <Plug>Sneak_S :call sneak#wrap(v:operator, 2, 1, 2, 1)
onoremap <silent> <Plug>Sneak_s :call sneak#wrap(v:operator, 2, 0, 2, 1)
xnoremap <silent> <Plug>Sneak_S :call sneak#wrap(visualmode(), 2, 1, 2, 1)
xnoremap <silent> <Plug>Sneak_s :call sneak#wrap(visualmode(), 2, 0, 2, 1)
nnoremap <silent> <Plug>Sneak_S :call sneak#wrap('', 2, 1, 2, 1)
nnoremap <silent> <Plug>Sneak_s :call sneak#wrap('', 2, 0, 2, 1)
nnoremap <silent> <Plug>SurroundRepeat .
vnoremap <Plug>(emmet-code-pretty) :call emmet#codePretty()
nnoremap <Plug>(emmet-merge-lines) :call emmet#mergeLines()
nnoremap <Plug>(emmet-anchorize-summary) :call emmet#anchorizeURL(1)
nnoremap <Plug>(emmet-anchorize-url) :call emmet#anchorizeURL(0)
nnoremap <Plug>(emmet-remove-tag) :call emmet#removeTag()
nnoremap <Plug>(emmet-split-join-tag) :call emmet#splitJoinTag()
nnoremap <Plug>(emmet-toggle-comment) :call emmet#toggleComment()
nnoremap <Plug>(emmet-image-encode) :call emmet#imageEncode()
nnoremap <Plug>(emmet-image-size) :call emmet#imageSize()
nnoremap <Plug>(emmet-move-prev-item) :call emmet#moveNextPrevItem(1)
nnoremap <Plug>(emmet-move-next-item) :call emmet#moveNextPrevItem(0)
nnoremap <Plug>(emmet-move-prev) :call emmet#moveNextPrev(1)
nnoremap <Plug>(emmet-move-next) :call emmet#moveNextPrev(0)
vnoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
nnoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
vnoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
nnoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
nnoremap <Plug>(emmet-update-tag) :call emmet#updateTag()
nnoremap <Plug>(emmet-expand-word) :call emmet#expandAbbr(1,"")
vnoremap <Plug>(emmet-expand-abbr) :call emmet#expandAbbr(2,"")
nnoremap <Plug>(emmet-expand-abbr) :call emmet#expandAbbr(3,"")
onoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, ''])
onoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, ''])
vnoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, visualmode()])
vnoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, visualmode()])
nnoremap <silent> <Plug>(coc-cursors-position) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'position', 'n'])
nnoremap <silent> <Plug>(coc-cursors-word) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'word', 'n'])
vnoremap <silent> <Plug>(coc-cursors-range) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'range', visualmode()])
nnoremap <Plug>(coc-refactor) :call CocActionAsync('refactor')
nnoremap <Plug>(coc-command-repeat) :call CocAction('repeatCommand')
nnoremap <Plug>(coc-float-jump) :call coc#util#float_jump()
nnoremap <Plug>(coc-float-hide) :call coc#util#float_hide()
nnoremap <Plug>(coc-fix-current) :call CocActionAsync('doQuickfix')
nnoremap <Plug>(coc-openlink) :call CocActionAsync('openLink')
nnoremap <Plug>(coc-references) :call CocAction('jumpReferences')
nnoremap <Plug>(coc-type-definition) :call CocAction('jumpTypeDefinition')
nnoremap <Plug>(coc-implementation) :call CocAction('jumpImplementation')
nnoremap <Plug>(coc-declaration) :call CocAction('jumpDeclaration')
nnoremap <Plug>(coc-definition) :call CocAction('jumpDefinition')
nnoremap <Plug>(coc-diagnostic-prev-error) :call CocActionAsync('diagnosticPrevious', 'error')
nnoremap <Plug>(coc-diagnostic-next-error) :call CocActionAsync('diagnosticNext', 'error')
nnoremap <Plug>(coc-diagnostic-prev) :call CocActionAsync('diagnosticPrevious')
nnoremap <Plug>(coc-diagnostic-next) :call CocActionAsync('diagnosticNext')
nnoremap <Plug>(coc-diagnostic-info) :call CocActionAsync('diagnosticInfo')
nnoremap <Plug>(coc-format) :call CocActionAsync('format')
nnoremap <Plug>(coc-rename) :call CocActionAsync('rename')
nnoremap <Plug>(coc-codeaction) :call CocActionAsync('codeAction', '')
vnoremap <Plug>(coc-codeaction-selected) :call CocActionAsync('codeAction', visualmode())
vnoremap <Plug>(coc-format-selected) :call CocActionAsync('formatSelected', visualmode())
nnoremap <Plug>(coc-codelens-action) :call CocActionAsync('codeLensAction')
nnoremap <Plug>(coc-range-select) :call CocAction('rangeSelect', '', v:true)
vnoremap <Plug>(coc-range-select-backward) :call CocAction('rangeSelect', visualmode(), v:false)
vnoremap <Plug>(coc-range-select) :call CocAction('rangeSelect', visualmode(), v:true)
nnoremap <F5> "=strftime("%Y-%m-%d %H:%M:")
nnoremap <M-l> l
nnoremap <M-k> k
nnoremap <M-j> j
nnoremap <M-h> h
tnoremap <M-l> l
tnoremap <M-k> k
tnoremap <M-j> j
tnoremap <M-h> h
imap S <Plug>ISurround
imap s <Plug>Isurround
inoremap <expr>  pumvisible() ? "\" : "\u\ "
imap  <Plug>Isurround
imap m <Plug>(emmet-merge-lines)
imap A <Plug>(emmet-anchorize-summary)
imap a <Plug>(emmet-anchorize-url)
imap k <Plug>(emmet-remove-tag)
imap j <Plug>(emmet-split-join-tag)
imap / <Plug>(emmet-toggle-comment)
imap I <Plug>(emmet-image-encode)
imap i <Plug>(emmet-image-size)
imap N <Plug>(emmet-move-prev)
imap n <Plug>(emmet-move-next)
imap D <Plug>(emmet-balance-tag-outword)
imap d <Plug>(emmet-balance-tag-inward)
imap u <Plug>(emmet-update-tag)
imap ; <Plug>(emmet-expand-word)
imap , <Plug>(emmet-expand-abbr)
let &cpo=s:cpo_save
unlet s:cpo_save
set cmdheight=2
set helplang=en
set hidden
set runtimepath=~/.config/nvim,~/.vim/plugged/LanguageClient-neovim/,~/.vim/plugged/coc.nvim/,~/.vim/plugged/vim-elixir/,~/.vim/plugged/rust.vim/,~/.vim/plugged/vim-processing/,~/.vim/plugged/vim-fish/,~/.vim/plugged/scvim/,~/.vim/plugged/emmet-vim/,~/.vim/plugged/fzf/,~/.vim/plugged/nerdtree/,~/.vim/plugged/goyo.vim/,~/.vim/plugged/lightline.vim/,~/.vim/plugged/vim-surround/,~/.vim/plugged/vim-sneak/,~/.vim/plugged/vim-pairtools/,~/.vim/plugged/csv.vim/,~/.vim/plugged/vim-tidal/,~/.vim/plugged/taskwiki/,~/.vim/plugged/vim-taskwarrior/,~/.vim/plugged/vimwiki/,~/.vim/plugged/vim-plugin-AnsiEsc/,~/.vim/plugged/vim-tiddlywiki/,~/.vim/plugged/notational-fzf-vim/,~/.vim/plugged/DrawIt/,~/.vim/plugged/firenvim/,/etc/xdg/nvim,~/.local/share/nvim/site,~/.local/share/flatpak/exports/share/nvim/site,/var/lib/flatpak/exports/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/var/lib/snapd/desktop/nvim/site,/usr/share/nvim/runtime,/var/lib/snapd/desktop/nvim/site/after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/var/lib/flatpak/exports/share/nvim/site/after,~/.local/share/flatpak/exports/share/nvim/site/after,~/.local/share/nvim/site/after,/etc/xdg/nvim/after,~/.vim/plugged/rust.vim/after,~/.vim/plugged/taskwiki/after,~/.config/nvim/after
set shiftwidth=2
set shortmess=filnxtToOFc
set showmatch
set statusline=%{coc#status()}%{get(b:,'coc_current_function','')}
set tabline=%!lightline#tabline()
set tabstop=2
set updatetime=300
set window=52
set nowritebackup
" vim: set ft=vim :

BIN
setSquare/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 KiB

45
setSquare/setSquare.pde Normal file
View file

@ -0,0 +1,45 @@
int numFrames = 50;
int n = 500;
class Thing {
float x = random(100, 400);
float y = random(100, 400);
float radius = random(2,15);
float size = random(1,2.5);
float offset = 9*noise(0.02*x, 0.02*y);
void show(){
stroke(255);
strokeWeight(size);
float t = 1.0*(frameCount-1)/numFrames;
rect(x,y, radius*sin(TWO_PI*t + offset), radius*sin(TWO_PI*t + offset));
//point(x + radius*cos(TWO_PI*t + offset), y + radius*sin(TWO_PI*t + offset));
}
}
Thing[] array = new Thing[n];
void setup(){
size(500,500);
for(int i=0;i<n;i++){
array[i] = new Thing();
}
}
void draw(){
background(0);
float t = 1.0*(frameCount-1)/numFrames;
stroke(255);
strokeWeight(10);
for(int i=0;i<n;i++){
array[i].show();
}
if(frameCount<=numFrames){
saveFrame("fr###.png");
}
}

273
square/.exrc Normal file
View file

@ -0,0 +1,273 @@
let s:cpo_save=&cpo
set cpo&vim
inoremap <Plug>(emmet-merge-lines) =emmet#util#closePopup() =emmet#mergeLines()
inoremap <Plug>(emmet-anchorize-summary) =emmet#util#closePopup() =emmet#anchorizeURL(1)
inoremap <Plug>(emmet-anchorize-url) =emmet#util#closePopup() =emmet#anchorizeURL(0)
inoremap <Plug>(emmet-remove-tag) =emmet#util#closePopup() =emmet#removeTag()
inoremap <Plug>(emmet-split-join-tag) :call emmet#splitJoinTag()
inoremap <Plug>(emmet-toggle-comment) =emmet#util#closePopup() =emmet#toggleComment()
inoremap <Plug>(emmet-image-encode) =emmet#util#closePopup() =emmet#imageEncode()
inoremap <Plug>(emmet-image-size) =emmet#util#closePopup() =emmet#imageSize()
inoremap <Plug>(emmet-move-prev-item) :call emmet#moveNextPrevItem(1)
inoremap <Plug>(emmet-move-next-item) :call emmet#moveNextPrevItem(0)
inoremap <Plug>(emmet-move-prev) =emmet#util#closePopup() =emmet#moveNextPrev(1)
inoremap <Plug>(emmet-move-next) =emmet#util#closePopup() =emmet#moveNextPrev(0)
inoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
inoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
inoremap <Plug>(emmet-update-tag) =emmet#util#closePopup() =emmet#updateTag()
inoremap <Plug>(emmet-expand-word) =emmet#util#closePopup() =emmet#expandAbbr(1,"")
inoremap <Plug>(emmet-expand-abbr) =emmet#util#closePopup() =emmet#expandAbbr(0,"")
inoremap <silent> <Plug>CocRefresh =coc#_complete()
inoremap <silent> <expr> <C-Space> coc#refresh()
inoremap <expr> <S-Tab> pumvisible() ? "\" : "\"
inoremap <F5> =strftime("%Y-%m-%d %H:%M:")
inoremap <M-l> l
inoremap <M-k> k
inoremap <M-j> j
inoremap <M-h> h
xmap <silent>  <Plug>(coc-range-select)
nmap <silent>  <Plug>(coc-range-select)
vmap c <Plug>(emmet-code-pretty)
nmap m <Plug>(emmet-merge-lines)
nmap A <Plug>(emmet-anchorize-summary)
nmap a <Plug>(emmet-anchorize-url)
nmap k <Plug>(emmet-remove-tag)
nmap j <Plug>(emmet-split-join-tag)
nmap / <Plug>(emmet-toggle-comment)
nmap I <Plug>(emmet-image-encode)
nmap i <Plug>(emmet-image-size)
nmap N <Plug>(emmet-move-prev)
nmap n <Plug>(emmet-move-next)
vmap D <Plug>(emmet-balance-tag-outword)
nmap D <Plug>(emmet-balance-tag-outword)
vmap d <Plug>(emmet-balance-tag-inward)
nmap d <Plug>(emmet-balance-tag-inward)
nmap u <Plug>(emmet-update-tag)
nmap ; <Plug>(emmet-expand-word)
vmap , <Plug>(emmet-expand-abbr)
nmap , <Plug>(emmet-expand-abbr)
map  ds <Plug>DrawItStop
map  di <Plug>DrawItStart
nmap  n <Plug>(pad-new)
nmap   <Plug>(pad-list)
nmap  s! <Plug>(pad-incremental-new-note)
nmap  s <Plug>(pad-incremental-search)
nmap  ss <Plug>(pad-search)
map  rwp <Plug>RestoreWinPosn
map  swp <Plug>SaveWinPosn
nmap <silent>  w m <Plug>VimwikiMakeTomorrowDiaryNote
nmap <silent>  w y <Plug>VimwikiMakeYesterdayDiaryNote
nmap <silent>  w t <Plug>VimwikiTabMakeDiaryNote
nmap <silent>  w w <Plug>VimwikiMakeDiaryNote
nmap <silent>  w i <Plug>VimwikiDiaryGenerateLinks
nmap <silent>  wi <Plug>VimwikiDiaryIndex
nmap <silent>  ws <Plug>VimwikiUISelect
nmap <silent>  wt <Plug>VimwikiTabIndex
nmap <silent>  ww <Plug>VimwikiIndex
nnoremap <silent>  p :CocListResume
nnoremap <silent>  k :CocPrev
nnoremap <silent>  j :CocNext
nnoremap <silent>  s :CocList -I symbols
nnoremap <silent>  o :CocList outline
nnoremap <silent>  c :CocList commands
nnoremap <silent>  e :CocList extensions
nmap  qf <Plug>(coc-fix-current)
nmap  ac <Plug>(coc-codeaction)
nnoremap <silent>  a :CocList diagnostics
xmap  a <Plug>(coc-codeaction-selected)
nmap  f <Plug>(coc-format-selected)
xmap  f <Plug>(coc-format-selected)
nmap  rn <Plug>(coc-rename)
map  q :wq
vmap  s :w
omap  s :w
map  t :NERDTreeToggle
xmap , <Plug>Sneak_,
omap , <Plug>Sneak_,
nmap , <Plug>Sneak_,
xmap ; <Plug>Sneak_;
omap ; <Plug>Sneak_;
nmap ; <Plug>Sneak_;
nmap S <Plug>Sneak_S
xmap S <Plug>VSurround
xmap Z <Plug>Sneak_S
omap Z <Plug>Sneak_S
vmap [% [%m'gv``
nmap <silent> [g <Plug>(coc-diagnostic-prev)
vmap ]% ]%m'gv``
nmap <silent> ]g <Plug>(coc-diagnostic-next)
vmap a% [%v]%
omap af <Plug>(coc-funcobj-a)
xmap af <Plug>(coc-funcobj-a)
nmap cS <Plug>CSurround
nmap cs <Plug>Csurround
nmap ds <Plug>Dsurround
vmap gx <Plug>NetrwBrowseXVis
nmap gx <Plug>NetrwBrowseX
xmap gS <Plug>VgSurround
nmap <silent> gr <Plug>(coc-references)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gd <Plug>(coc-definition)
omap if <Plug>(coc-funcobj-i)
xmap if <Plug>(coc-funcobj-i)
xmap s <Plug>Sneak_s
nmap s <Plug>Sneak_s
nmap ySS <Plug>YSsurround
nmap ySs <Plug>YSsurround
nmap yss <Plug>Yssurround
nmap yS <Plug>YSurround
nmap ys <Plug>Ysurround
omap z <Plug>Sneak_s
vnoremap <silent> <Plug>NetrwBrowseXVis :call netrw#BrowseXVis()
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())
noremap <silent> <Plug>DrawItStop :set lz :call DrawIt#DrawItStop() :set nolz
noremap <silent> <Plug>DrawItStart :set lz :call DrawIt#DrawItStart() :set nolz
noremap <silent> <Plug>(pad-incremental-new-note) :call pad#GlobalIncrementalSearch(0)
noremap <silent> <Plug>(pad-incremental-search) :call pad#GlobalIncrementalSearch(1)
noremap <silent> <Plug>(pad-search) :call pad#SearchPads()
noremap <silent> <Plug>(pad-new) :Pad new
noremap <silent> <Plug>(pad-list) :Pad ls
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()
omap <Plug>SneakPrevious <Plug>Sneak_,
omap <Plug>SneakNext <Plug>Sneak_;
xmap <Plug>SneakPrevious <Plug>Sneak_,
xmap <Plug>SneakNext <Plug>Sneak_;
nmap <Plug>SneakPrevious <Plug>Sneak_,
nmap <Plug>SneakNext <Plug>Sneak_;
omap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
omap <Plug>(SneakStreak) <Plug>SneakLabel_s
xmap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
xmap <Plug>(SneakStreak) <Plug>SneakLabel_s
nmap <Plug>(SneakStreakBackward) <Plug>SneakLabel_S
nmap <Plug>(SneakStreak) <Plug>SneakLabel_s
xmap <Plug>VSneakPrevious <Plug>Sneak_,
xmap <Plug>VSneakNext <Plug>Sneak_;
xmap <Plug>VSneakBackward <Plug>Sneak_S
xmap <Plug>VSneakForward <Plug>Sneak_s
nmap <Plug>SneakBackward <Plug>Sneak_S
nmap <Plug>SneakForward <Plug>Sneak_s
onoremap <silent> <Plug>SneakLabel_S :call sneak#wrap(v:operator, 2, 1, 2, 2)
onoremap <silent> <Plug>SneakLabel_s :call sneak#wrap(v:operator, 2, 0, 2, 2)
xnoremap <silent> <Plug>SneakLabel_S :call sneak#wrap(visualmode(), 2, 1, 2, 2)
xnoremap <silent> <Plug>SneakLabel_s :call sneak#wrap(visualmode(), 2, 0, 2, 2)
nnoremap <silent> <Plug>SneakLabel_S :call sneak#wrap('', 2, 1, 2, 2)
nnoremap <silent> <Plug>SneakLabel_s :call sneak#wrap('', 2, 0, 2, 2)
onoremap <silent> <Plug>Sneak_T :call sneak#wrap(v:operator, 1, 1, 0, 0)
onoremap <silent> <Plug>Sneak_t :call sneak#wrap(v:operator, 1, 0, 0, 0)
xnoremap <silent> <Plug>Sneak_T :call sneak#wrap(visualmode(), 1, 1, 0, 0)
xnoremap <silent> <Plug>Sneak_t :call sneak#wrap(visualmode(), 1, 0, 0, 0)
nnoremap <silent> <Plug>Sneak_T :call sneak#wrap('', 1, 1, 0, 0)
nnoremap <silent> <Plug>Sneak_t :call sneak#wrap('', 1, 0, 0, 0)
onoremap <silent> <Plug>Sneak_F :call sneak#wrap(v:operator, 1, 1, 1, 0)
onoremap <silent> <Plug>Sneak_f :call sneak#wrap(v:operator, 1, 0, 1, 0)
xnoremap <silent> <Plug>Sneak_F :call sneak#wrap(visualmode(), 1, 1, 1, 0)
xnoremap <silent> <Plug>Sneak_f :call sneak#wrap(visualmode(), 1, 0, 1, 0)
nnoremap <silent> <Plug>Sneak_F :call sneak#wrap('', 1, 1, 1, 0)
nnoremap <silent> <Plug>Sneak_f :call sneak#wrap('', 1, 0, 1, 0)
onoremap <silent> <Plug>SneakRepeat :call sneak#wrap(v:operator, sneak#util#getc(), sneak#util#getc(), sneak#util#getc(), sneak#util#getc())
onoremap <silent> <Plug>Sneak_S :call sneak#wrap(v:operator, 2, 1, 2, 1)
onoremap <silent> <Plug>Sneak_s :call sneak#wrap(v:operator, 2, 0, 2, 1)
xnoremap <silent> <Plug>Sneak_S :call sneak#wrap(visualmode(), 2, 1, 2, 1)
xnoremap <silent> <Plug>Sneak_s :call sneak#wrap(visualmode(), 2, 0, 2, 1)
nnoremap <silent> <Plug>Sneak_S :call sneak#wrap('', 2, 1, 2, 1)
nnoremap <silent> <Plug>Sneak_s :call sneak#wrap('', 2, 0, 2, 1)
nnoremap <silent> <Plug>SurroundRepeat .
vnoremap <Plug>(emmet-code-pretty) :call emmet#codePretty()
nnoremap <Plug>(emmet-merge-lines) :call emmet#mergeLines()
nnoremap <Plug>(emmet-anchorize-summary) :call emmet#anchorizeURL(1)
nnoremap <Plug>(emmet-anchorize-url) :call emmet#anchorizeURL(0)
nnoremap <Plug>(emmet-remove-tag) :call emmet#removeTag()
nnoremap <Plug>(emmet-split-join-tag) :call emmet#splitJoinTag()
nnoremap <Plug>(emmet-toggle-comment) :call emmet#toggleComment()
nnoremap <Plug>(emmet-image-encode) :call emmet#imageEncode()
nnoremap <Plug>(emmet-image-size) :call emmet#imageSize()
nnoremap <Plug>(emmet-move-prev-item) :call emmet#moveNextPrevItem(1)
nnoremap <Plug>(emmet-move-next-item) :call emmet#moveNextPrevItem(0)
nnoremap <Plug>(emmet-move-prev) :call emmet#moveNextPrev(1)
nnoremap <Plug>(emmet-move-next) :call emmet#moveNextPrev(0)
vnoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
nnoremap <Plug>(emmet-balance-tag-outword) :call emmet#balanceTag(-1)
vnoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
nnoremap <Plug>(emmet-balance-tag-inward) :call emmet#balanceTag(1)
nnoremap <Plug>(emmet-update-tag) :call emmet#updateTag()
nnoremap <Plug>(emmet-expand-word) :call emmet#expandAbbr(1,"")
vnoremap <Plug>(emmet-expand-abbr) :call emmet#expandAbbr(2,"")
nnoremap <Plug>(emmet-expand-abbr) :call emmet#expandAbbr(3,"")
onoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, ''])
onoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, ''])
vnoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, visualmode()])
vnoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, visualmode()])
nnoremap <silent> <Plug>(coc-cursors-position) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'position', 'n'])
nnoremap <silent> <Plug>(coc-cursors-word) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'word', 'n'])
vnoremap <silent> <Plug>(coc-cursors-range) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'range', visualmode()])
nnoremap <Plug>(coc-refactor) :call CocActionAsync('refactor')
nnoremap <Plug>(coc-command-repeat) :call CocAction('repeatCommand')
nnoremap <Plug>(coc-float-jump) :call coc#util#float_jump()
nnoremap <Plug>(coc-float-hide) :call coc#util#float_hide()
nnoremap <Plug>(coc-fix-current) :call CocActionAsync('doQuickfix')
nnoremap <Plug>(coc-openlink) :call CocActionAsync('openLink')
nnoremap <Plug>(coc-references) :call CocAction('jumpReferences')
nnoremap <Plug>(coc-type-definition) :call CocAction('jumpTypeDefinition')
nnoremap <Plug>(coc-implementation) :call CocAction('jumpImplementation')
nnoremap <Plug>(coc-declaration) :call CocAction('jumpDeclaration')
nnoremap <Plug>(coc-definition) :call CocAction('jumpDefinition')
nnoremap <Plug>(coc-diagnostic-prev-error) :call CocActionAsync('diagnosticPrevious', 'error')
nnoremap <Plug>(coc-diagnostic-next-error) :call CocActionAsync('diagnosticNext', 'error')
nnoremap <Plug>(coc-diagnostic-prev) :call CocActionAsync('diagnosticPrevious')
nnoremap <Plug>(coc-diagnostic-next) :call CocActionAsync('diagnosticNext')
nnoremap <Plug>(coc-diagnostic-info) :call CocActionAsync('diagnosticInfo')
nnoremap <Plug>(coc-format) :call CocActionAsync('format')
nnoremap <Plug>(coc-rename) :call CocActionAsync('rename')
nnoremap <Plug>(coc-codeaction) :call CocActionAsync('codeAction', '')
vnoremap <Plug>(coc-codeaction-selected) :call CocActionAsync('codeAction', visualmode())
vnoremap <Plug>(coc-format-selected) :call CocActionAsync('formatSelected', visualmode())
nnoremap <Plug>(coc-codelens-action) :call CocActionAsync('codeLensAction')
nnoremap <Plug>(coc-range-select) :call CocAction('rangeSelect', '', v:true)
vnoremap <Plug>(coc-range-select-backward) :call CocAction('rangeSelect', visualmode(), v:false)
vnoremap <Plug>(coc-range-select) :call CocAction('rangeSelect', visualmode(), v:true)
nnoremap <F5> "=strftime("%Y-%m-%d %H:%M:")
nnoremap <M-l> l
nnoremap <M-k> k
nnoremap <M-j> j
nnoremap <M-h> h
tnoremap <M-l> l
tnoremap <M-k> k
tnoremap <M-j> j
tnoremap <M-h> h
imap S <Plug>ISurround
imap s <Plug>Isurround
inoremap <expr>  pumvisible() ? "\" : "\u\ "
imap  <Plug>Isurround
imap m <Plug>(emmet-merge-lines)
imap A <Plug>(emmet-anchorize-summary)
imap a <Plug>(emmet-anchorize-url)
imap k <Plug>(emmet-remove-tag)
imap j <Plug>(emmet-split-join-tag)
imap / <Plug>(emmet-toggle-comment)
imap I <Plug>(emmet-image-encode)
imap i <Plug>(emmet-image-size)
imap N <Plug>(emmet-move-prev)
imap n <Plug>(emmet-move-next)
imap D <Plug>(emmet-balance-tag-outword)
imap d <Plug>(emmet-balance-tag-inward)
imap u <Plug>(emmet-update-tag)
imap ; <Plug>(emmet-expand-word)
imap , <Plug>(emmet-expand-abbr)
let &cpo=s:cpo_save
unlet s:cpo_save
set cmdheight=2
set helplang=en
set hidden
set runtimepath=~/.config/nvim,~/.vim/plugged/LanguageClient-neovim/,~/.vim/plugged/coc.nvim/,~/.vim/plugged/vim-elixir/,~/.vim/plugged/rust.vim/,~/.vim/plugged/vim-processing/,~/.vim/plugged/vim-fish/,~/.vim/plugged/scvim/,~/.vim/plugged/emmet-vim/,~/.vim/plugged/fzf/,~/.vim/plugged/nerdtree/,~/.vim/plugged/goyo.vim/,~/.vim/plugged/lightline.vim/,~/.vim/plugged/vim-surround/,~/.vim/plugged/vim-sneak/,~/.vim/plugged/vim-pairtools/,~/.vim/plugged/csv.vim/,~/.vim/plugged/vim-tidal/,~/.vim/plugged/taskwiki/,~/.vim/plugged/vim-taskwarrior/,~/.vim/plugged/vimwiki/,~/.vim/plugged/vim-plugin-AnsiEsc/,~/.vim/plugged/vim-pad/,~/.vim/plugged/vim-tiddlywiki/,~/.vim/plugged/DrawIt/,~/.vim/plugged/firenvim/,/etc/xdg/nvim,~/.local/share/nvim/site,~/.local/share/flatpak/exports/share/nvim/site,/var/lib/flatpak/exports/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/var/lib/snapd/desktop/nvim/site,/usr/share/nvim/runtime,/var/lib/snapd/desktop/nvim/site/after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/var/lib/flatpak/exports/share/nvim/site/after,~/.local/share/flatpak/exports/share/nvim/site/after,~/.local/share/nvim/site/after,/etc/xdg/nvim/after,~/.vim/plugged/rust.vim/after,~/.vim/plugged/taskwiki/after,~/.config/nvim/after
set shiftwidth=2
set shortmess=filnxtToOFc
set showmatch
set statusline=%{coc#status()}%{get(b:,'coc_current_function','')}
set tabline=%!lightline#tabline()
set tabstop=2
set updatetime=300
set window=52
set nowritebackup
" vim: set ft=vim :

BIN
square/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

35
square/square.pde Normal file
View file

@ -0,0 +1,35 @@
int samplesPerFrame = 5;
int numFrames = 50;
float shutterAngle = 1.5;
void setup(){
size(500,500);
}
void draw(){
background(0);
float t = 1.0*(frameCount-1)/numFrames;
stroke(144 - 63 * sin(TWO_PI*t));
strokeWeight(4 + 2 * sin(TWO_PI*t));
for(int i = 100; i < 250; i += 10) {
//right quarter
line(500 - i, 500 - i - 10*sin(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t), i + 10 * cos(TWO_PI*t));
line(500 - i, 500 - i - 10*sin(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t));
//top quarter
line(i + 50, i - i/10*sin(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t), i + 10 * cos(TWO_PI*t));
line(i + 50, i - i/10*sin(TWO_PI*t), i + 10 * cos(TWO_PI*t), i + 10 * cos(TWO_PI*t));
//left quarter
line(i, i - 10*sin(TWO_PI*t), i + 10 * cos(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t));
line(i, i - 10*sin(TWO_PI*t), i + 10 * cos(TWO_PI*t), i + 10 * cos(TWO_PI*t));
//bottom quarter
line(i + 50, 500 - i - i/10*sin(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t));
line(i + 50, 500 - i - i/10*sin(TWO_PI*t), i + 10 * cos(TWO_PI*t), 500 - i + 10 * cos(TWO_PI*t));
}
if(frameCount<=numFrames){
saveFrame("fr###.png");
}
}

BIN
triSize/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
triSize/out2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 KiB

57
triSize/triSize.pde Normal file
View file

@ -0,0 +1,57 @@
int numFrames = 50;
int n = 40;
class Tri {
float h, x, y, offset, stroke;
Tri(float h_) {
h = 5*h_;
x = 250;
y = 250;
stroke = random(255);
offset = 9*noise(0.02*x, 0.03*y);
}
void show() {
float x1,y1,x2,y2,x3,y3;
x1 = x + (h/2) + offset;
y1 = y + offset;
x2 = y2 = y - (h/2) - offset;
x3 = x + (h/2) - offset;
y3 = y - (h/2) + offset;
stroke(0, stroke, 0);
line(x1, y1, x2, y2);
line(x2, y2, x3, y3);
line(x3, y3, x1, y1);
}
}
Tri[] array = new Tri[n];
void setup(){
size(500,500);
for(int i=0;i<n;i++){
array[i] = new Tri(i);
}
}
void draw(){
background(0);
float t = 1.0*(frameCount-1)/numFrames;
stroke(255);
strokeWeight(6);
translate(width/4,height/6);
for(int i=0;i<n;i++){
rotate(t*sin(TWO_PI/n));
array[i].show();
}
//point(250+50*cos(TWO_PI*t),250+50*sin(TWO_PI*t));
if(frameCount<=numFrames){
saveFrame("fr###.png");
}
}

BIN
triangle/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

95
triangle/triangle.pde Normal file
View file

@ -0,0 +1,95 @@
int numFrames = 100;
int m = 1000;
void setup(){
size(500,500,P3D);
stroke(255);
fill(255);
}
class Tri{
float x1,y1,x2,y2,x3,y3;
float theta;
}
float x1(float t){
return 0.50*width + 50*cos(TWO_PI*t);
}
float y1(float t){
return 0.5*height + 50*sin(TWO_PI*t);
}
float x2(float t){
return 0.50*width + 20*cos(2*TWO_PI*t);
}
float y2(float t){
return 0.5*height + 20*sin(2*TWO_PI*t);
}
float x3(float t) {
return 0.5*width + 120 * cos(2*TWO_PI*t);
}
float y3 (float t) {
return 0.5*height + 120 * cos(TWO_PI*t);
}
void push() {
pushMatrix();
pushStyle();
}
void pop() {
popStyle();
popMatrix();
}
int parts = 8;
int n = 20;
void drawTri(int j) {
float t = 1.0*(frameCount-1)/numFrames;
pushStyle();
strokeWeight(2);
stroke(255,100);
for(int i=0;i<=m;i++){
float tt = 1.0*i/m;
float x = lerp(x1(t),x2(t),tt);
float x2 = lerp(x2(t),x3(t),tt);
float x3 = lerp(x3(t),x1(t),tt);
float y = lerp(y1(t),y2(t),tt);
float y2 = lerp(y2(t),y3(t),tt);
float y3 = lerp(y3(t),y1(t),tt);
point(x,y);
point(x2,y2);
point(x3,y3);
}
popStyle();
}
void draw(){
float t = 1.0*(frameCount - 1)/numFrames;
background(0);
// triangle(x1(t), y1(t), x2(t), y2(t), x3(t), y3(t));
push();
translate(width/4,height/6);
for(int i=0;i<n;i++){
push();
rotate(i*TWO_PI/n);
drawTri(i);
pop();
}
pop();
if (frameCount<=numFrames){
saveFrame("fr###.png");
}
}

BIN
unsatisfying/out.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

View file

@ -0,0 +1,73 @@
int samplesPerFrame = 5;
int numFrames = 500;
float shutterAngle = 1.5;
boolean recording = true;
int n = 1000;
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
else
return 1 - 0.5 * pow(2*(1 - p), g);
}
class Thing{
float size = random(1,15);
float offset = random(0, 0.6);
float theta;
float de = random(5, 20);
Thing(float theta_){
theta = theta_;
}
void show(){
stroke(255,100);
strokeWeight(size);
float t = 1.0*(frameCount-1)/numFrames;
float t2 = ease(t, 8);
float radius = 150 + 200*sin(TWO_PI*t2 + offset);
// right side
float x = 250 + radius*cos(theta)*cos(theta) + noise(0.04);
float y = 250 + radius*sin(theta) + noise(0.02);
point(x, y);
// left side
// throw on an easing function or delay here?
float x2 = 250 - radius*cos(theta)*cos(theta) + noise(0.04);
float y2 = 250 - radius*sin(theta) + noise(0.02);
point(x2, y2);
}
}
Thing[] array = new Thing[n];
void setup(){
size(500, 500, P3D);
for(int i=0;i<n;i++){
float theta = TWO_PI*i/n;
array[i] = new Thing(theta);
}
}
void draw(){
background(0);
float t = 1.0*(frameCount-1)/numFrames;
stroke(255 * sin(TWO_PI*t), 0 * cos(TWO_PI*t), 255 * cos(TWO_PI*t));
strokeWeight(10 + 10*sin(TWO_PI*t));
point(250,250);
for(int i=0;i<n;i++){
array[i].show();
}
if (frameCount<=numFrames){
saveFrame("fr###.png");
}
}

11
y0x3y/y0x3y.pde Normal file
View file

@ -0,0 +1,11 @@
int x1 = 0;
int y1 = 50;
int x2 = 50;
int y2 = 0;
int x3 = 100;
int y3 = 50;
triangle(x1,y2, x2, y2, x3,y3);
//for(int i = 0; i < 4; i++) {
// triangle(x1 * i, y2 * i, x2 * i, y2 * i, x3 * i, y3 * i);
//}