@altavir I am using Java JTS
https://github.com/locationtech/jts (and some other, related libraries) for this type of work. I am developing an online GIS-exploration system using Kotlin/Spring and JTS is providing all the coordinate transformation logic (though it's quite cumbersome). I don't require distance calculations, but I am using area calculations, polygon intersection and containment, centroid calculation, etc.
It would be handy to have those in Kotlin with a more modern API