]> gitweb.factorcode.org Git - factor.git/commitdiff
Looks like golden-section is good to go for extra
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Mon, 22 Dec 2008 06:05:19 +0000 (00:05 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Mon, 22 Dec 2008 06:05:19 +0000 (00:05 -0600)
extra/golden-section/authors.txt [new file with mode: 0644]
extra/golden-section/deploy.factor [new file with mode: 0755]
extra/golden-section/golden-section.factor [new file with mode: 0644]
extra/golden-section/summary.txt [new file with mode: 0644]
extra/golden-section/tags.txt [new file with mode: 0644]
unmaintained/golden-section/authors.txt [deleted file]
unmaintained/golden-section/deploy.factor [deleted file]
unmaintained/golden-section/golden-section.factor [deleted file]
unmaintained/golden-section/summary.txt [deleted file]
unmaintained/golden-section/tags.txt [deleted file]

diff --git a/extra/golden-section/authors.txt b/extra/golden-section/authors.txt
new file mode 100644 (file)
index 0000000..6cfd5da
--- /dev/null
@@ -0,0 +1 @@
+Eduardo Cavazos
diff --git a/extra/golden-section/deploy.factor b/extra/golden-section/deploy.factor
new file mode 100755 (executable)
index 0000000..0aa3185
--- /dev/null
@@ -0,0 +1,12 @@
+USING: tools.deploy.config ;
+V{
+    { deploy-ui? t }
+    { deploy-io 1 }
+    { deploy-reflection 1 }
+    { deploy-compiler? t }
+    { deploy-math? t }
+    { deploy-word-props? f }
+    { deploy-c-types? f }
+    { "stop-after-last-window?" t }
+    { deploy-name "Golden Section" }
+}
diff --git a/extra/golden-section/golden-section.factor b/extra/golden-section/golden-section.factor
new file mode 100644 (file)
index 0000000..8d1e6b4
--- /dev/null
@@ -0,0 +1,54 @@
+
+USING: kernel namespaces math math.constants math.functions math.order
+       arrays sequences
+       opengl opengl.gl opengl.glu ui ui.render ui.gadgets ui.gadgets.theme
+       ui.gadgets.cartesian colors accessors combinators.cleave
+       processing.shapes ;
+
+IN: golden-section
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+! omega(i) = 2*pi*i*(phi-1)
+
+! x(i) = 0.5*i*cos(omega(i))
+! y(i) = 0.5*i*sin(omega(i))
+
+! radius(i) = 10*sin((pi*i)/720)
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: omega ( i -- omega ) phi 1- * 2 * pi * ;
+
+: x ( i -- x ) [ omega cos ] [ 0.5 * ] bi * ;
+: y ( i -- y ) [ omega sin ] [ 0.5 * ] bi * ;
+
+: center ( i -- point ) { x y } 1arr ;
+
+: radius ( i -- radius ) pi * 720 / sin 10 * ;
+
+: color ( i -- i ) dup 360.0 / dup 0.25 1 rgba boa >fill-color ;
+
+: line-width ( i -- i ) dup radius 0.5 * 1 max glLineWidth ;
+
+: draw ( i -- ) [ center ] [ radius 1.5 * 2 * ] bi circle ;
+
+: dot ( i -- ) color line-width draw ;
+
+: golden-section ( -- ) 720 [ dot ] each ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: <golden-section> ( -- gadget )
+  <cartesian>
+    {  600 600 }       >>pdim
+    { -400 400 }       x-range
+    { -400 400 }       y-range
+    [ golden-section ] >>action ;
+
+: golden-section-window ( -- )
+  [ <golden-section> "Golden Section" open-window ] with-ui ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+MAIN: golden-section-window
diff --git a/extra/golden-section/summary.txt b/extra/golden-section/summary.txt
new file mode 100644 (file)
index 0000000..5f44091
--- /dev/null
@@ -0,0 +1 @@
+Golden section demo
diff --git a/extra/golden-section/tags.txt b/extra/golden-section/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
diff --git a/unmaintained/golden-section/authors.txt b/unmaintained/golden-section/authors.txt
deleted file mode 100644 (file)
index 6cfd5da..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Eduardo Cavazos
diff --git a/unmaintained/golden-section/deploy.factor b/unmaintained/golden-section/deploy.factor
deleted file mode 100755 (executable)
index 0aa3185..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-USING: tools.deploy.config ;
-V{
-    { deploy-ui? t }
-    { deploy-io 1 }
-    { deploy-reflection 1 }
-    { deploy-compiler? t }
-    { deploy-math? t }
-    { deploy-word-props? f }
-    { deploy-c-types? f }
-    { "stop-after-last-window?" t }
-    { deploy-name "Golden Section" }
-}
diff --git a/unmaintained/golden-section/golden-section.factor b/unmaintained/golden-section/golden-section.factor
deleted file mode 100644 (file)
index 8d1e6b4..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-
-USING: kernel namespaces math math.constants math.functions math.order
-       arrays sequences
-       opengl opengl.gl opengl.glu ui ui.render ui.gadgets ui.gadgets.theme
-       ui.gadgets.cartesian colors accessors combinators.cleave
-       processing.shapes ;
-
-IN: golden-section
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-! omega(i) = 2*pi*i*(phi-1)
-
-! x(i) = 0.5*i*cos(omega(i))
-! y(i) = 0.5*i*sin(omega(i))
-
-! radius(i) = 10*sin((pi*i)/720)
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-: omega ( i -- omega ) phi 1- * 2 * pi * ;
-
-: x ( i -- x ) [ omega cos ] [ 0.5 * ] bi * ;
-: y ( i -- y ) [ omega sin ] [ 0.5 * ] bi * ;
-
-: center ( i -- point ) { x y } 1arr ;
-
-: radius ( i -- radius ) pi * 720 / sin 10 * ;
-
-: color ( i -- i ) dup 360.0 / dup 0.25 1 rgba boa >fill-color ;
-
-: line-width ( i -- i ) dup radius 0.5 * 1 max glLineWidth ;
-
-: draw ( i -- ) [ center ] [ radius 1.5 * 2 * ] bi circle ;
-
-: dot ( i -- ) color line-width draw ;
-
-: golden-section ( -- ) 720 [ dot ] each ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-: <golden-section> ( -- gadget )
-  <cartesian>
-    {  600 600 }       >>pdim
-    { -400 400 }       x-range
-    { -400 400 }       y-range
-    [ golden-section ] >>action ;
-
-: golden-section-window ( -- )
-  [ <golden-section> "Golden Section" open-window ] with-ui ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-MAIN: golden-section-window
diff --git a/unmaintained/golden-section/summary.txt b/unmaintained/golden-section/summary.txt
deleted file mode 100644 (file)
index 5f44091..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Golden section demo
diff --git a/unmaintained/golden-section/tags.txt b/unmaintained/golden-section/tags.txt
deleted file mode 100644 (file)
index cb5fc20..0000000
+++ /dev/null
@@ -1 +0,0 @@
-demos