-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.txt
221 lines (129 loc) · 4.92 KB
/
demo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
rails new demo -d postgresql -T
./configure; make; make install in gsl direcotry to install GSL
http://rb-gsl.rubyforge.org/files/rdoc/ref_rdoc.html documentation for GNU scientific library
Ruby/GSL is a ruby interface to the GNU Scientific Library (GSL), for numerical computing with Ruby.
require("gsl")
brew install gsl
https://github.com/SciRuby/rb-gsl
####
poly=GSL::Poly[1,2]
http://www.gnu.org/software/plotutils/plotutils.html #plot library
http://www.gnu.org/software/plotutils/manual/en/plotutils.html # manual
http://www.gnu.org/software/plotutils/manual/plotutils_ex.pdf
require 'rubygems' # if installed via RubyGems
require 'gsl'
###############################stoppen the GSL and went to SCIRUBY
https://github.com/sciruby/sciruby
https://github.com/SciRuby/gnuplotrb
Hope you love daru! For enhanced interactivity and better visualizations,
consider using gnuplotrb and nyaplot with iruby. For statistics use the
statsample family.
Read the README for interesting use cases and examples
/////////////////
Welcome to Nyaplot
___/|
o.O|
(___)
U
Thank you for installing Nyaplot gem.
We strongly recommend you to install IRuby, an interactive
Ruby environment on web browser at the same time.
$ gem install iruby
If you wonder how to use Nyaplot, see /path/to/nyaplot/examples/notebook
and run `iruby notebook` in the directory.
You can find these notebook on your browser:
http://nbviewer.ipython.org/github/domitry/nyaplot/blob/master/examples/notebook/Index.ipynb
You can also use nyaplot without IRuby like /path/to/nyaplot/examples/rb
or on your browser:
https://github.com/domitry/nyaplot/tree/master/examples/rb
Feel free to raise Issue or Pull-request on GitHub.
Most pull-request might be accepted unless it is broken or too destructive.
Enjoy Nyaplot!
/////////////////////
installed iruby
https://www.quora.com/Whats-the-best-graphing-charting-package-for-use-in-Rails-apps
notebooks on sciruby examples
https://github.com/SciRuby/sciruby-notebooks
###some examples on plotting
http://wanzuhao.com/
def f(x)
Math.exp(x)
end
#### canvas
http://gnuplot.sourceforge.net/demo_canvas_4.6/
set terminal canvas
gnuplot
plot(x)
#######
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.terminal "canvas"
plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines"
ds.linewidth = 4
end
end
end
#### https://github.com/SciRuby/gnuplotrb is a different gem
from https://github.com/rdp/ruby_gnuplot i am using the second one.
###########
the javascripts that are being called
https://github.com/gnuplot/gnuplot/tree/master/term/js
####################
create controller for every function
for everyone of these controllers,
can have different transformation controller (finds the function, applies transformation to it ) -- horizontal shifts, vertical shifts, amplification, stretches, all combos (this option requires submit before )
horizontal shift works as follows: on h there is an j-query that sends an ajax req to the same controller but to a different function TRANSFORM, passes the parameter to it
the function TRANSFORM makes new @x and @y and sends it as a json-object.
1)have a create action that generates x,y, redirect to show.
2)show contains the javascript that renders the graph.
the javascript also has
1)jquery on $('a') that sends an ajax back to the controller, asking what function the user is on. pass
2) on success:
create a model that randomly sends the user to the different functions
#####TO DO
1) make it so that the scales are not responsive! CHECK
2) when type in 22
3) radians for sin n cos
4) when zero, it makes it flat CHECK
5) have the original graph showing on the transformation
6) make the algebreic expression better. is hacky right now.
7) fix natural language
8) give some options to the user, like : x-axis, y-axis number of points? color maybe
started on demos2(new rails project)
bin/rails g controller sin_functions
bin/rails g controller polynomials
##########################################################
bin/rails g model function name:string
bin/rails g controller functions
#todo
fix show all functions
fix activating the different modes (a button)
link to create
soundeffects
colors
xaxis y axis adjustment
comments? for users
bootstrap that shit
sinus radius n stuff
pretty equations
get the algebra-part on the show page
fix! compress by a factor of -2
###
questions: why the - in x**2
######to do before presentation
horizontally stretched by a factor of 1/1/2 units -
clean and remove dead code
add tests
fix the "compressed by a factor of -1/3"
label x and y axis
think about what to say
why does the links in the navbar disapear
drop table? what function to use.
level-up
level-down
line-chart logo