{"author_url":"https://blog.hatena.ne.jp/obelisk2/","blog_url":"https://obelisk.hatenablog.com/","categories":["Ruby","\u6570\u5b66"],"provider_url":"https://hatena.blog","type":"rich","version":"1.0","blog_title":"Camera Obscura","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/o/obelisk2/20210116/20210116152153.png","description":"\u30b3\u30fc\u30c9\u3002 require \"numo/gnuplot\" dx = 0.0001 dif = ->(f, x) { (f.(x+dx)-f.(x))/dx }.curry f = ->(x) { x*x-2*x+1 } dif_f = dif.(f) xs = -5.step(5, 0.1).to_a ys1 = xs.map(&f) ys2 = xs.map(&dif_f) Numo.gnuplot do set terminal: :x11 unset :key set xrange: -5..5 set yrange: -5..10 set grid: true plot xs, ys1,\u2026","width":"100%","height":"190","author_name":"obelisk2","provider_name":"Hatena Blog","url":"https://obelisk.hatenablog.com/entry/2021/01/16/152252","title":"\u95a2\u6570\u3092\u5fae\u5206\u3057\u3066 gnuplot \u3067\u51fa\u529b\uff08Ruby\uff09","published":"2021-01-16 15:22:52","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2021%2F01%2F16%2F152252\" title=\"\u95a2\u6570\u3092\u5fae\u5206\u3057\u3066 gnuplot \u3067\u51fa\u529b\uff08Ruby\uff09 - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}