]> gitweb.factorcode.org Git - factor.git/blob - extra/math/function-tools/function-tools.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / math / function-tools / function-tools.factor
1 ! Copyright © 2008 Reginald Keith Ford II
2 ! Tools for quickly comparing, transforming, and evaluating mathematical Factor functions
3
4 USING: kernel math arrays sequences sequences.lib ;
5 IN: math.function-tools 
6 : difference-func ( func func -- func ) [ bi - ] 2curry ;
7 : eval ( x func -- pt ) dupd call 2array ;
8 : eval-inverse ( y func -- pt ) dupd call swap 2array ;
9 : eval3d ( x y func -- pt ) [ 2dup ] dip call 3array ;