I am working on some simulation software that will represent a number of entities in a defined geographic area in the world. The part of the software that I am currently working on is to implement some pre-defined behaviour for one of the entities, regarding its movement in the simulation. This entity currently has several 'options' of behaviour that have already been defined- such as commanding it to move from A to B in a straight line, or a curved line, etc.
What I a trying to do at the moment is to get the entity to apprach B from A, and once it reaches a certain distance from B, to start spiralling around B, starting with a radius of that distance, and increasing the radius at a constant rate as the entity spirals around B.
The only information that I currently have available to me regarding an entity's location in the simulation are its latitude & longitude coordinates (i.e. its location on a globe- a geodetic system). However, since the software I am using is not simulating a full globe at any time, but only a very small area of its surface, the surface is simulated as being flat rather than curved (a cartesian system).
What I need to do is to convert the latitude & longitude coordinates into X & Y coordinates (i.e. map from a geodetic system to a cartesian system).
Does anyone know if there are any C++ libraries that have this fuctionality? Or if not, can anyone recommend somewhere that I could find a formula for how to do this?
Thanks in advance!