de Casteljau's algorithm - らんだむな記憶のsvgのお絵描きをする際にpythonが役に立った。
$ python Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a=complex(50,50) >>> b=complex(100,700) >>> c=complex(600,900) >>> d=complex(900,50) >>> e=a+0.3*(b-a) >>> f=b+0.3*(c-b) >>> g=c+0.3*(d-c) >>> h=e+0.3*(f-e) >>> i=f+0.3*(g-f) >>> h (120.5+399.5j) >>> i (382+725.5j) >>> h+0.3*(i-h) (198.95+497.3j)
して、この座標で線を引いたり、丸を書いて平行移動したりした。svg的にはy軸は下方向が正の方向らしいが、それだと描きにくいので、上下を反転させて平行移動させて、あたかもy軸が上方向が正であるかのようにした。affine変換を施した、とか書くとちょっとカッコイイだろうか。