proj4 is what you are looking for. This is a serious mapping tool, a mature and well respected projection api. It is mainly popular for direct and inverse transformations between geographical coordinates (lat / lng) and planar (x, y). The geometry of coordinates with planar coordinates is much simpler than with geographic coordinates.
The documentation is not the best. Since it can also be used as a standalone program, I would start reading the man page to get an introduction. Command line switches are the same parameters that are used to initialize the structure when using api. Then read the api docs - the function calls listed in the API Basic Functions section can be very useful.
Change with what was started as a comment on the OP: Projecting on planar coordinates is attractive for many reasons: the coordinates are compared in linear units rather than angular. Distance becomes a trivial calculation of the hypotenuse. Axis-oriented rectangles are intuitive to use. Elementary rectangular trigonometry can be used to calculate new points, for example. in the middle, offset, etc. It is all provided that the extents of a region are not massive, for example. continental scale. If your dataset is within a power square (which is still large), you'll be fine with this approach.
source share