Degree of rotation is broken

I rotate the shape manually by iterating over the vertices.
But as with a normal turn, the turn comes from the first peak.

I have a Vector that means the position of this shape, but after rotation the vector is not in the middle.

How do I count the turn correctly?
So that the midpoint (position) is centered after the turn)

Please, I’m bad at angles and other math. I’m stupid.
Help.

the code with which I rotate the figure:

STAGES OF WRONG ROTATION FOR VISIBILITY:
(you can see how the center-position of the shape remains outside the shape)



I fixed everything. no help needed. excuse me.

2 Likes

Please don’t call yourself stupid. It’s normal to encounter errors, and it’s normal to spend a lot of time debugging your code.

If you figured this out, do you mind posting what you learned? It might help the next person who has a similar problem.

2 Likes

it was necessary to move the vector that took the point onto itself.
Move first to coordinates 0 and then back to as it is advised to do with the usual works there.

1 Like