Pulling lon and lat data for a navigation program

Hey,

I was searching the forum for some information but wasn´t really successfull yet, now I hope that you can help me.

At the moment I’m trying to create some kind of navigation program.
The plan would be to place some mouseclicks on the map and pull out the lon and lat data of the dots from the map. Then run the algorithm with the lon and lat information to get a drivable path connecting those clicklocations.
Herefore I´d also need to be able to compare some of the calculated points of the path to the osm highway data and see if they are close to the road.

Can someone tell me if this would be possible with JOSM or if I´d need to use another programm?

Thank you very much for your help in advance!

Kind Regards,
Philipp

Do you know the OSM wiki page about Routing? for online and offline solutions? and numerous opensource projects?

see https://wiki.openstreetmap.org/wiki/Routing