0

I am working on some game code and I have an image that I need to figure out the percentage from the top and left relative to the coordinates on a map, left on the map is 9688 and right is -5300. How would I figure out the percentage in from the left 5978 is?

  • 1
    Do you mean $\frac{x-\text{left}}{\text{right}-\text{left}}$? With $x=5978$, $\text{left}=9688$, $\text{right}=-5300$, this gives about $0.2475$ i.e. about $24.75%$ and a quarter of the way looks reasonable – Henry Mar 20 '22 at 02:03
  • This is brilliant, thanks – Ben Ringrose Mar 20 '22 at 02:22

0 Answers0