Skip to content

Instantly share code, notes, and snippets.

@YuukiToriyama
Created June 29, 2019 13:53
Show Gist options
  • Save YuukiToriyama/07a62c7f3c7797dfe239a78267336574 to your computer and use it in GitHub Desktop.
Save YuukiToriyama/07a62c7f3c7797dfe239a78267336574 to your computer and use it in GitHub Desktop.
ImageMagickで円グラフアニメーションを描く【シェル芸】
mkdir im
for i in {01..51}; do
seq 1 $i | awk '{r = 8*atan2(1,1)/50 * $1; printf "%f,%f ", 200*cos(r) + 250, 200*sin(r) + 250}' | xargs -I@ convert -size 500x500 xc:Yellow -fill Red -stroke Black -draw 'path "M 250,250 @ z"' im/$i.png
done
convert im/*.png -delay 10 circle_graph.gif
rm -r im
@YuukiToriyama
Copy link
Author

実行結果(circle_graph.gif)
circle_graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment