Coordinates is a Java library designed to handle coordinate systems (including curvilinear, non-orthogonal ones).
Some of the supported features include:
- coordinate systems take units into account. For example
CoordinateSystem csys = new CartesianCoordinates(3); // use constructor directly. 3 for 3D CoordinateSystem csys2 = CoordinateSystem.from("cart", 3, new Axis(0, "km")); // string-based construction double[] pos = {1000, 2, 3}; CoordinateSystems.transform(pos, csys, csys2); // yields {1,2,3} as "m" is the default
- numerical implementations for a lot of functions, e.g. the metric tensor, gradients, divergences etc.
- for the coordinate systems shipped symbolic implementations are provided where possible
- a python script to easily create full symbolic implementations, including examples (e.g. here) from the shipped implementations generated via the script
- full implementations:
- Cartesian coordinates (nD)
- Polar coordinates (2D)
- Bipolar coordinates (2D)
- Bispherical coordinates (3D)
- Cylindrical coordinates (3D)
- Oblate spheroidal coordinates (3D)
- Prolate spheroidal coordinates (3D)
- 6-sphere coordinates (3D)
- Spherical coordinates (nD)
- Toroidal coordinates (3D)
The artifact can be found at maven central:
<dependency>
<groupId>eu.hoefel</groupId>
<artifactId>coordinates</artifactId>
<version>1.1.5</version>
</dependency>
Coordinates is designed to work with Java 17+.