# Degree of rotation is broken

**URL:** <https://discourse.processing.org/t/degree-of-rotation-is-broken/23428>\
**Category:** Processing\
**Created:** [August 22, 2020, 4:00pm UTC](https://discourse.processing.org/t/degree-of-rotation-is-broken/23428 "2020-08-22T16:00:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoName](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@NoName](https://discourse.processing.org/u/NoName)\
**Post date:** [August 22, 2020, 4:00pm UTC](https://discourse.processing.org/t/degree-of-rotation-is-broken/23428/1 "2020-08-22T16:00:43Z")

</div>

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:

 ![Screenshot_20200822-185354](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/17a22958502c4ec8e7fa4b76f0ae41b7ccf7bde4.png)

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

 ![Screenshot_20200822-185248](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/14061b021132fd47b1181b0fbd4c1ca4360e8635.png)  
 ![Screenshot_20200822-185253](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1881433d03e823cf066cf29009338d47f33667bf.png)  
 ![Screenshot_20200822-185258](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/719fbd201a7322e8ddbb4b1efa8912f89d77ad69.png)

---

<div class="post-metadata">

**Author:** ![NoName](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@NoName](https://discourse.processing.org/u/NoName)\
**Post date:** [August 22, 2020, 4:33pm UTC](https://discourse.processing.org/t/degree-of-rotation-is-broken/23428/2 "2020-08-22T16:33:45Z")

</div>

I fixed everything. no help needed. excuse me.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [August 22, 2020, 10:34pm UTC](https://discourse.processing.org/t/degree-of-rotation-is-broken/23428/3 "2020-08-22T22:34:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NoName](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@NoName](https://discourse.processing.org/u/NoName)\
**Post date:** [August 22, 2020, 11:02pm UTC](https://discourse.processing.org/t/degree-of-rotation-is-broken/23428/4 "2020-08-22T23:02:34Z")

</div>

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.
