Pari/GP Geometry

This is some coordinate geometry functions for Pari/GP. Most are fairly simple lengths, areas, and inertia. Calculations are kept exact using quads as much as possible. See the comments in and for details.

geom_area_of_polygon([0, 1, 2+I, 1+2*I, I]) == 5/2 is basic functions. The further has functions for mass moment of inertia represented in 3×3 matrices. Both are slightly preliminary in places, but do some useful things as far as they go.

This code is free software (free as in freedom), published under the terms of the GNU General Public License (v3 or higher). Download version 2 here, (25k, and sig) (30k, and sig)
geom-2.tar.gz (55k, and sig)

Just the .gp files are enough to run. The tar has some self-tests. The sig files are Gnu PG ascii armoured signatures generated from my key.

This page Copyright 2017, 2019 Kevin Ryde, except for the GPLv3 logo which is Copyright Free Software Foundation and used here in accordance with its terms.

(Back to the sitemap, or the Pari/GP section there).