Skip to content

agdturner/ccg-v2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A modular Java library for 2D Euclidean spatial vector geometry.

The spatial dimensions are defined by orthogonal coordinate axes X and Y that meet at the origin point <x,y> where the coordinates x=y=0.

There are two implementations distinguished by the type of numbers used for calculations and to represent coordinates:

  1. Coordinates and calculations using Java double precision primitive numbers. These use a small user defined epsilon (a small number) which is used to determine if there are vector intersections. This is limited by the vaguaries of floating point arithmetic.
  2. Coordinates and calculations using a combination of BigRational and Math_BigRationalSqrt numbers. These use a user provided Order Of Magnitude (OOM) and RoundingMode (RM) to store process coordinates. With this for example, it is possible to have a coordinate at precisely < $\sqrt{2}$, $\sqrt{3}$ >.

The code is being developed along with ccg-r2d - rendering code that helps demonstrate capabilities of the library.

Dependencies

  • Java SE 21
  • There are only a few light weight dependencies, please see the POM for details.

Development plans/ideas

  • Add functionality for clipping shapes.
  • Add functionality for merging shapes.
  • Add functionality for calculating the intersection of two polygons.
  • Make a versioned release on Maven Central.
  • Community development:
    • Raise awareness
    • Develop use cases

Contributing

  • Thanks for thinking about this.
  • If this is to form into a collaborative project, it could do with a Code of Conduct and Contributor Guidelines based on something like this: Open Source Guide

LICENSE

Acknowledgements and thanks

  • The University of Leeds has indirectly supported this work by employing me over the years and encouraging me to develop the skills necessary to produce this library.
  • Thank you Eric for the BigMath library.