Get the X and Y rotation points at some distance from another point

I found several searches for solutions, and they are either language specific or too complex. I just need to get the distance from point n from another point times n. I use this for a project in HTML5 canvas. I know there is a rotate function, but I work with paths, and I don't think this will work. Despite everything, I just need a formula in which I can insert x, y, distance and direction.

+3
source share
2 answers
newx = distance * Math.cos(direction) + x
newy = distance * Math.sin(direction) + y
+4
source

, . , . X, Y.

:

  • .
  • X, .
  • Y, .
  • X Y .
  • X Y "" .
0

Source: https://habr.com/ru/post/1780590/


All Articles