<gnomoni.ca

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.

Download the documentation (PDF).

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.

Note that the Inkscape drawing software shows curved text as straight unless you use a special modification which you can obtain by saving the SVG in Inkscape format. It's to do with versions of the SVG specification.