Mathematics Function Diagram Generator

How does it work?

Enter your mathematics function diagram commands in the textarea below





Results appear here

generated diagrams: 00005

Available commands:

Title
- Takes just the title as its argument.
Comment
- You can add comment lines using this command.
Grid
- You can specify SIMPLE, HALF or FULL (default).
Start-x
- Sets the start value of the domain for the x variable.
End-x
- Sets the end value of the domain for the x variable
Width
- Sets the width of the image (in cm). Default 20.
Height
- Sets the height of the image (in cm). Default 20.
Shift-Grid
- Gives an extra half on the grid around the image, result image increases by 1cm width and height. Use before functions.
Shift-x
- Shifts the x axis down (positive) or up (negative) in cm. (Integer)
Shift-y
- Shifts the y axis right (positive) or left (negative) in cm. (Integer)
Scale-x
- Sets the scale on the x axis.
Scale-y
- Sets the scale on the y axis.
Step
- Sets the step size on the x variable. Default step size 0.1 (cm).
Color
- Accepted color for svg file used for the color of the line. Stays active.
Stroke
- Sets the width of the line. Stays active.
Constant
- Efficient way to draw the graph of a constant function.
Linear
- Efficient way to draw the graph of a linear function.
Polynomial
- Draw any polynomial graph. Input the coefficients in integer or floating point separated by spaces.
Rational
- Draw a rational function.
Exponential
- Draw an exponential function. Needs four parameters a, b, c and d, c * exp (ax + b) + d.
Logarithm
- Draw a logarithmic function. Needs four parameters a, b, c and d, c * ln (ax + b) + d.
Square-root
- Draw a square root function. Needs four parameters a, b, c and d, c * square-root (ax + b) + d.
Power
- Draw a power function. Needs six parameters a, b, c, d, f and g, f * power (d * ( x + c)) ( a / b) + g.
Normal
- Draw a (Standard) normal graph. Needs two parameters, mu and sigma.
Sine
- Draw a sine function. Needs four parameters a, b, c and d, c * sine (ax + b) + d.
Cosine
- Draw a cosine function. Needs four parameters a, b, c and d, c * cos (ax + b) + d.

No capital letters or lower case letters required.

In case an error occurs, it will be displayed.

No errors means an image is generated.

Use shift-grid before any functions or functions will be misaligned.

For Sine and Cosine functions parameter b will mean units of tau.

Do use Start-x and/or End-x with functions that are not defined on the whole displayed domain.

Examples how to use the Mathematics diagram creator.

Polynomial Functions Example Code

title Polynomial Example
comment Place your explanatory comments after this comment command
comment you can set the type of grid
GRID SIMPLE
comment put shift-grid before any functions or functions will be misaligned
shift-grid 
color green
stroke 12
color darkolivegreen
POLYNOMIAL 1 0 -7
color red
stroke 5
comment a constant function can be made using POLYNOMIAL type
POLYNOMIAL 4 
color orange 
comment but CONSTANT is the better way to go
constant 9
comment Polynomial is also for straight lines, but LINEAR is more direct.
color navy
stroke 8
POLYNOMIAL 2 -4

This is the image that is generated by this example code:

This is the example generated svg file

Polynomial and Linear Example Code

GRID half
shift-grid 
stroke 8
color darkolivegreen
POLYNOMIAL 0.025 0 -1 0 1
color navy
stroke 8
LINEAR 0.5 -2 

And this is the image that is generated by this example code:

This is the example generated svg file

Exponential and logarithm Example Code

title Exponential and logarithm
GRID SIMPLE
comment put shift-grid before any functions or functions will be misaligned
shift-grid 
SHIFT-X 2
shift-y -3
scale-y 0.5
scale-X 0.5
step 0.01
color green
stroke 5
comment this is a linear function
LINEAR 1.0 0.0
color blue
EXPONENTIAL 1.0 0.0 1.0 0.0
color red
stroke 5
comment next is a logarithm
start-x 0.0
LOGARITHM 1.0 0.0 1.0 0.0

And this is the image that is generated by this example code:

This is the example generated svg file

Standard Normal Example Code

title Standard Normal
GRID SIMPLE
comment put shift-grid before any functions or functions will be misaligned
shift-grid 
color orange
SHIFT-X 2
scale-y 0.05
scale-X 0.5
color green
stroke 5
comment this is a standard normal distribution with mu=0 and sigma=1
NORMAL 0.0 1.0
color red
NORMAL 0.0 2.0
color orange
stroke 5
NORMAL 0.0 0.5 

And this is the image that is generated by this example code:

This is the example generated svg file

Rational Example Code

title Rational Example
comment Place your explanatory comments after this comment command
comment you can set the type of grid
GRID SIMPLE
comment put shift-grid before any functions or functions will be misaligned
shift-grid 
color green
stroke 12
color darkolivegreen
RATIONAL 1.0 1.0 / 1.0 -1.0
color red
stroke 7
RATIONAL 2.0 -1.0 / 1.0 2.0

And this is the image that is generated by this example code:

This is the example generated svg file

Sine and Cosine Example Code

title Sine and Cosine Example
shift-grid
stroke 8
color darkolivegreen
SINE -1.0 -2.0 1.0 0.0
color navy
stroke 8
SINE 0.5 1 2 0
color red
COSINE 2.0 0.5 3.0 0.0 

And this is the image that is generated by this example code:

This is the example generated svg file

Power Example Code

title Power Example
shift-grid
stroke 8
color darkolivegreen
comment POWER a b c d f g" g " f * POWER d * "x " c" " a " b " 
POWER 1.0 3.0 0.0 1.0 1.0 0.0
color red
start-x 0.0
POWER 1.0 2.0 0.0 1.0 1.0 0.0
color red
start-x 0.0
POWER 1.0 2.0 0.0 1.0 -1.0 0.0
stroke 8
color navy
POWER 1.0 3.0 2.0 8.0 1.0 3.0
color purple
POWER 1.0 3.0 -1.0 1.0 -2.0 0.0

And this is the image that is generated by this example code:

This is the example generated svg file