I had previously asked a question here, how to get the real coordinates of the points in the following figure by Mathematica:

enter image description here

Two answers were provided, which by using them, I could get almost all points, with a few exceptions. Now, I need to get the real coordinates of the remaining ones. I'd like to know how can this be done manually for one arbitrary point in the above figure? In other words, if by using "Get Coordinates", I get the coordinates of a point, how can I convert this to real coordinates?

P.S. $2$, $8$, and $16$, on the $x$-axis above, are just labels (see also the answer in the above link).


1 Answer 1


If I understand correctly, you want to determine the real coordinates from geometric coordinates taken from a picture:

Toward this aim, you need 2 points from which you know the real as well as the geometric coordinates. Measure the real and geometric coordinates of 2 points: p1->p1r={rx1,ry1} ->p1g{gx1,gy1} and p2->p2r={rx2,ry2} ->p2g{gx2,gy2}

To make this easier, we could take the first point as the origin of the real coordinates: p1r={0,0}, p2g={gx1,gy1}. To determine the geometric and real coordinates of the second point we could measure a point on the x axis: pax->paxr={rax,0}->paxg={gax,..} and a point on the y axis: pay->payr={0,ray}->payg={..,gya}, where ".." means: it does not matter. From this we may get the coordinates of the second point: p2->p2r={rax,ray} ->p2g={gax,gay}.

With the data: p1r,p2r,p1g,p2g we can define a function that transform any geometric to real coordinates:

g2r[pg:{gx_,gy_}]:=Module[{scales=(p1r-p2r)/(p1g-p2g)},(pg-p1g) scales + p1r]
  • $\begingroup$ 😉 Glad to be of some help. $\endgroup$ Dec 5, 2022 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.