jooGraphFunction ================ Plots mathematical functions into smooth Bézier curves. While specialized software do exist they tend make segmented graphs. Sometimes the convenience of being in one package and and having well behaved smooth curves is desirable. Simply, some shapes are much easier to express in mathematical form than draw accurately by hand. .. figure:: img/jooGraphFunctionSamples.png **Image 1**: Example functions (jump to tutorial_) The Interface ------------- .. figure:: img/jooGraphFunctionDialog.png **Image 2**: Main dialog The main dialog consists of two sections the functions and plotting range information Parametric Function: x: Function of x axis. X axis in illustrator is the horizontal increasing to the right. y: Function of y axis. Y axis in illustrator is the vertical. Newer Illustrators use the web/GUI convention and increasing value moves downward in the scene. Range: min: Minimum value of variable `t` to use. This defines the start of the plot range. max: Maximum value of variable `t` to use. This defines the end of the plot range. step: The sampling interval at which the control points will be spaced. They start from min and end sampling when max is reached or exceeded. Preview: Draw the plot on screen while editing. *Note*: It will only update once you change fields to keep the program responsive. Copy: Commit the current state as a path into Illustrator. Ok: Commit the current state as a path into Illustrator and exit dialog. Tutorial_ --------- <<<<<<< local Using jooGraphFunctionDialog is pretty simple, but requires some mathematical knowledge to utilize well. Let us disccuss how to draw a `archimedean spiral `_. First let us see what Wikipedia has to say about the subject. Wikipedia lists the formula for the spiral as :math:`r = a + b * \theta`. This is in polar formulation, no problem let us just formulate it in `Cartesian parametric form `_. By replacing r with :math:`sin(t)` for x and :math:`cos(t)` for y. Then we replace :math:`\theta` by :math:`t` and we get: ======= Using jooGraphFunctionDialog is pretty simple, but requires some mathematical knowledge to utilize well. Let us disccuss how to draw a `archimedean spiral `_. First let us see what Wikipedia has to say about the subject. Wikipedia lists the formula for the spiral as :math:`r = a + b * \theta`. This is in polar formulation, no problem let us just formulate it in `Cartesian parametric form `_. By replacing r with :math:`sin(t)` for x and :math:`cos(t)` for y we get: >>>>>>> other .. math:: \begin{cases} x = (a + b * t)\sin(t)\\ y = (a + b * t)\cos(t) \end{cases} Don't worry if you didn't understand a thing. You can use the formula even without understanding it. Now let us type this into our dialog, by substituting a with 20 and b with 1 we get: .. figure:: img/jooGraphFunctionArchimedes_1.png **Image 2**: Formula typed into the dialog Pleas note that we need to change the range also. Max should be PI * 2 * number of desired revolutions. You can now experiment by changing the values 20, 1 and the number in max value. Please note that the script uses radians instead of degrees as angular unit.