K
K
krembrule20162019-06-08 18:00:25
Java
krembrule2016, 2019-06-08 18:00:25

How to link degrees and coordinates?

Hello!
5cfbcb8ca35d4910767282.png
I have a sprite. And I twist it like this. (Attention to the square (sprite) and the arrow, which tells us that the sprite is rotating about the center.

sprite.setRotation((float)Math.toDegrees((float)Math.sin(i))); Вот так кодом кручу.

From the center of the sprite, one after the other, dots form a line.
These three circles are like points, which are one after the other and a hoba is a line.
(Of course, it would have been more logical to use a line, but as the saying goes, "Enter through the narrow gate, for broad and spacious is the road that leads to destruction, and many go by it, while narrow is the gate and strait is the road that leads to life, and few find it" (Matthew 7:13, 14).)
But, you can also answer about the line. Although I suspect that the principle of the solution in this case will be similar. Alya manipulation with the coordinates of the end of the line.
So, how to link degrees and point coordinates, starting with the next one from the one in the center of the sprite? Those. I need to recalculate the coordinates of the points based on the degrees to which I rotated the sprite.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-06-08
@krembrule2016

krembrule2016 ,

based on degrees

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question