I'm running into an unforeseen implementation issue in my research project.
Basically, I am given two 2D points [P1 = (x1,y1) and P2 = (x2,y2)] on a sheet of paper (i.e. a 2D plane).
Next, I fold this sheet of paper into a cylinder. For example, if the leftmost x-coordinate on the x-axis is 0 and the rightmost is 999 then, after folding the paper into a cylinder, 0 and 999 are right next to each other on the x-axis (on the back/hidden side of the cylinder). In other words, the paper has been folded such that the left and right edges of the paper now touch each other.
Now, I need to find the shortest distance between P1 and P2, which are now located on the surface of this cylinder (I believe this is called a geodesic).
Unfortunately, despite hours of searching, I can't find an answer that:
a) Refers to this exact same situation.
b) Is mathematically simple enough for me to understand and implement in a program.
One answer that I found (http://www.ifsc.usp.br/~gabriel.luchini/comment_1.pdf) described this exact situation, but the equation was mind-numbingly complex, involving differentiation, integration and a ton of esoteric symbols whose meaning escapes me.
Another answer (https://stackoverflow.com/questions/7981815/projection-of-a-plane-onto-a-cylinder) seems to describe how to convert the 2D point's coordinates to equivalent 3D coordinates on the cylinder surface but I'm not sure if it's correct and, even if it was, I still wouldn't know how to calculate the distance between the resulting points.
Technically, I do know the length of 1 'arc' along the 'front' of the cylinder's surface, between the 2 points -- I assume that it is simply the same as the Euclidean distance between the same 2 points on the initial 2D plane (before I folded it into a cylinder). However, I have no idea how to get the other arc, along the 'back' of the cylinder's surface.
So, keeping in mind that my math skills are bad, would someone please give me a simple formula (without differentiation and/or integration) to find the shortest distance between two 2D points along the surface of a cylinder??
Sorry for the long question, and thanks for your time!