Castle Game Engine
← Users Developers →
 
Intro
 
News
 
view3dscene
 
The Castle
 
All Programs
 
Forum
 
Donate
 
Engine
 
VRML/X3D
 
Blender
 

glplotter (version 1.2.5)
and gen_function (version 1.0.5)

Screenshot from "glplotter"
Screenshot from "glplotter"
Screenshot from "glplotter"

glplotter draws graphs. It can generate graphs of various functions (you can specify any mathematical expression as function expression, e.g. "sin(x) + x^2").

glplotter can also load a graph from a file. This is useful if your graph data doesn't come from any mathematical expression — e.g. maybe it's some collected statistical data. Maybe your data is not even a function at all — actually any shape consisting of line segments may be displayed by glplotter.

That's pretty much everything you need to know... you can download and run glplotter now, the interface should be self-explanatory.

  1. Download
  2. Command-line parameters
  3. Graph file format
  4. Requirements
  5. gen_function
  6. Syntax of mathematical expressions

Download

Download glplotter:
 Linux<br/>(32 bit)
Linux
(32 bit)
 Linux<br/>(64 bit, x86_64)
Linux
(64 bit, x86_64)
 Windows<br/>(32 bit, works on 64-bit too)
Windows
(32 bit, works on 64-bit too)
 Mac OS X<br/>(32 bit)
Mac OS X
(32 bit)

If you like this software, please consider donating.

No installation is required. Just download and unpack these archives wherever you want, and run the program inside. The documentation (this web page) is also included inside (look in the documentation/ subdirectory) for offline viewing.

This is free/open-source software. Developers can download sources of this program.

Command-line parameters

You can pass at command-line file names from which to load graphs. Dash (-) as filename means "standard input".

E.g. you could pipe the output of gen_function program to glplotter, like

  gen_function "sin(x)" -10 10 0.1 | glplotter -
which will display the graph of sinus for X in [-10; 10]. Commands like
  gen_function "sin(x)" -10 10 0.1 > plot.1
  gen_function "x^2" -10 10 0.1 > plot.2
  glplotter plot.1 plot.2
will display graphs of sinus and x2 at once. Of course, in case of function expressions, it's usually more comfortable to set them up inside glplotter using "Functions" menu.

Options --light and --dark allow you to choose appropriate color scheme.

Option --custom-size SIZE (or -c SIZE) specifies size for

See also standard parameters of OpenGL programs and standard parameters of all programs.

Graph file format

Graph for glplotter is actually just a set of line segments. They don't have to correspond to any function — they can show any shape, they can cross each other etc.

File format:

Whitespace at the beginning and end of the line is always ignored.

Requirements

glplotter requires:

gen_function

gen_function generates graph file from given function expression. It's seldom needed — glplotter can make a graph from function expression on it's own, see menu "Functions".

Download gen_function:
 Linux<br/>(32 bit)
Linux
(32 bit)
 Linux<br/>(64 bit, x86_64)
Linux
(64 bit, x86_64)
 Windows<br/>(32 bit, works on 64-bit too)
Windows
(32 bit, works on 64-bit too)
 Mac OS X<br/>(32 bit)
Mac OS X
(32 bit)

If you like this software, please consider donating.

Call like:

  gen_function <function> <x1> <x2> <xstep>

This will write on standard output the graph of function <function> for x in range [<x1> ; <x2>] (with x sampled at each <xstep> distance). The graph will be in format understood by glplotter.

For example

  gen_function "x^2" 0 5 1
will write
# File generated by gen_function on 14-3-2004 at 23:34:37
#   function = x^2
#   x1 = 0
#   x2 = 5
#   xstep = 1
name=x^2
 0.0000000000000000E+0000  0.0000000000000000E+0000
 1.0000000000000000E+0000  1.0000000000000000E+0000
 2.0000000000000000E+0000  4.0000000000000000E+0000
 3.0000000000000000E+0000  9.0000000000000000E+0000
 4.0000000000000000E+0000  1.6000000000000000E+0001
 5.0000000000000000E+0000  2.5000000000000000E+0001

No installation is required. Just download and unpack these archives wherever you want, and run the program inside. The documentation (this web page) is also included inside (look in the documentation/ subdirectory) for offline viewing.

This is free/open-source software. Developers can download sources of this program.

Syntax of mathematical expressions

Short overview of mathematical expressions syntax: this is really just normal syntax of mathematical expressions, as used in all software and resembling normal mathematical notation. When we deal with function expressions, then x represents the argument, e.g. (x+4)*3+2, sin(x) etc.

For detailed information about syntax and built-in functions, see CastleScript language reference. We use a subset of CastleScript syntax, allowing only a simple expression as a function expression, operating on argument "X".