]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/splines/splines.factor
factor: trim using lists
[factor.git] / extra / math / splines / splines.factor
index dc22224416e1b5d28e192a90cb9688f4df51df40..9005c2d0c38f598969d540021c29f05617081ce9 100644 (file)
@@ -1,9 +1,7 @@
 ! Copyright (C) 2010 Erik Charlebois
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators kernel locals math math.combinatorics
-math.polynomials opengl.gl sequences ui.gadgets ui.gadgets.panes
-ui.render arrays grouping math.vectors assocs
-ui.gestures ;
+USING: arrays combinators grouping kernel math
+math.combinatorics math.polynomials math.vectors sequences ;
 IN: math.splines
 
 <PRIVATE
@@ -12,7 +10,7 @@ IN: math.splines
 
 :: hermite-polynomial ( p0 m0 p1 m1 -- poly )
     p0
-    m0 
+    m0
     -3 p0 * -2 m0 * + 3 p1 * + m1 neg +
     2 p0 * m0 + -2 p1 * + m1 +
     4array ;
@@ -53,9 +51,9 @@ PRIVATE>
         ] each-index
     ] each-index
     acc ;
-    
+
 :: <cubic-hermite-curve> ( p0 m0 p1 m1 -- polynomials )
-    p0 length iota [
+    p0 length <iota> [
         {
             [ p0 nth ] [ m0 nth ]
             [ p1 nth ] [ m1 nth ]