2

Starting from an image loaded on my server, I would need to trace, for example, two points and identify the angle of the line that passes between the two points.

Like this Example.

Unfortunately I'm not finding any way, do you have any idea how I can do it via HTML5 / PHP / JS?

halfer
  • 18,701
  • 13
  • 79
  • 158
Echelon
  • 31
  • 5
  • Your question seems broad. Do you already have the points as `(x, y)` coordinate values? If so then see [How to calculate an angle from points?](https://stackoverflow.com/q/9614109). But if you don't have the points and are asking, *How can I recognize two points on an image, then draw a line between them on that image, then calculate the angle between them?* then that probably cannot be answered in a single question here, and would need to be broken down into smaller parts. – dbc Jul 19 '19 at 18:46
  • [Draw a line on an Image using javascript](https://stackoverflow.com/q/12477364/3744182) and [JS Draw line between two or more points](https://stackoverflow.com/q/17777362/3744182) and [draw imaginary path between two points and print image along that path?](https://stackoverflow.com/q/14557242/3744182) may also be relevant. – dbc Jul 19 '19 at 18:51
  • Thanks so much @dbc. It's just what I'm looking for. How could I replace the "mousedown" functions to work even from a touch screen? Thanks a lot! – Echelon Jul 22 '19 at 09:09
  • Sorry, I don't know. You might want to ask a second question for that. – dbc Jul 22 '19 at 09:23

0 Answers0