summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc3b051)
raw | patch | inline | side by side (parent: dc3b051)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 24 Nov 2006 21:36:32 +0000 (21:36 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 24 Nov 2006 21:36:32 +0000 (21:36 +0000) |
share/extensions/funcplot.inx | patch | blob | history | |
share/extensions/funcplot.py | patch | blob | history |
index a7318ccbf80c51dc8fd35ab9b9819a8647b3b748..5c9ba6230dd760b5f354c4dbebc85d5fb7368274 100644 (file)
<page name="sampling" _gui-text="Sampling">\r
<param name="xstart" type="float" min="-1000.0" max="1000.0" _gui-text="Start x-value">0.0</param>\r
<param name="xend" type="float" min="-1000.0" max="1000.0" _gui-text="End x-value">1.0</param>\r
+ <param name="times2pi" type="boolean" _gui-text="Multiply x-range by 2*pi">false</param>\r
<param name="ybottom" type="float" min="-1000.0" max="1000.0" _gui-text="y-value of rectangle's bottom">0.0</param>\r
<param name="ytop" type="float" min="-1000.0" max="1000.0" _gui-text="y-value of rectangle's top">1.0</param>\r
<param name="samples" type="int" min="2" max="1000" _gui-text="Samples">8</param>\r
index f555bb612c3e3574a23fee73493a0402549be447..d4154dfe7ea1226be17da36b793b9e813ea61314 100644 (file)
from random import *\r
\r
def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, top, \r
- fx = "sin(x)", fpx = "cos(x)", fponum = True):\r
-\r
+ fx = "sin(x)", fpx = "cos(x)", fponum = True, times2pi = False):\r
+ \r
+ if times2pi == True:\r
+ xstart = 2 * pi * xstart\r
+ xend = 2 * pi * xend \r
+ \r
# step is the distance between nodes on x\r
step = (xend - xstart) / (samples-1)\r
third = step / 3.0\r
action="store", type="float", \r
dest="xend", default=1.0,\r
help="End x-value")\r
+ self.OptionParser.add_option("--times2pi",\r
+ action="store", type="inkbool", \r
+ dest="times2pi", default=True,\r
+ help="Multiply x-range by 2*pi") \r
self.OptionParser.add_option("--ybottom",\r
action="store", type="float", \r
dest="ybottom", default=-1.0,\r
w,h,x,y,\r
self.options.fofx, \r
self.options.fpofx,\r
- self.options.fponum)))\r
+ self.options.fponum,\r
+ self.options.times2pi)))\r
newpath.setAttribute('title', self.options.fofx)\r
\r
#newpath.setAttribute('desc', '!func;' + self.options.fofx + ';' \r