]> gitweb.factorcode.org Git - factor.git/commitdiff
vector bilerp word
authorJoe Groff <arcata@gmail.com>
Wed, 20 May 2009 15:26:55 +0000 (10:26 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 20 May 2009 15:26:55 +0000 (10:26 -0500)
basis/math/vectors/vectors.factor

index bad2733bbf1176585d608c759c3ffbc2e4742388..0fe1404516a62ca1f451d25ae5ac9fdbc85fa770 100644 (file)
@@ -58,6 +58,10 @@ IN: math.vectors
 : vnlerp ( a b t -- a_t )
     [ lerp ] curry 2map ;
 
+: vbilerp ( aa ba ab bb {t,u} -- a_tu )
+    [ first vnlerp ] [ second vnlerp ] bi-curry
+    [ 2bi@ ] [ call ] bi* ;
+
 HINTS: vneg { array } ;
 HINTS: norm-sq { array } ;
 HINTS: norm { array } ;