<Javascript gMmath.js and gPlot.js libraries<

This website does not carry out any logging or tracking of your visits or activity on the site.

Overview

The gPlot.js library wraps the SVG functions of HTML and Javascript to provide drawing features needed to write online sundial drawing programs. It aims to hide the complexity of the native SVG interface while providing enough functionality for you to place shapes and text in a 2D drawing area, with control of color, dimensions, etc. Circular and elliptical arcs, and compound (multi-point) lines can be drawn. Curved text is also supported.

The gMath.js library is a small set of Javascript functions intended to speed up the process of writing Javascript for dialing projects. Its main purpose is to provide trigonometry functions in degrees and using their ordinary names, such as sin(x) instead of Math.sin(Math.radians(x)). It also provides some basic math functions that are not provided by Javascript's built-in Math functionality.

You do not need to install the libaries - you simply link to them from your web page (see documentation).

Download the documentation (PDF). Note that gMath.js and gPlot.js are both described in the one document.

Sample gPlot.js drawing

Here are examples of lines, arcs, filled arcs, circles, polygons, straight text, and text on circles and ellipses - more than enough to draw a sundial. Below the drawing you will find buttons showing some of the kinds of other control you can use.