# I need know vertex after rotate

**URL:** <https://discourse.processing.org/t/i-need-know-vertex-after-rotate/12719>\
**Category:** Coding Questions\
**Created:** [July 15, 2019, 3:47am UTC](https://discourse.processing.org/t/i-need-know-vertex-after-rotate/12719 "2019-07-15T03:47:54Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 15, 2019, 11:52pm UTC](https://discourse.processing.org/t/i-need-know-vertex-after-rotate/12719/16 "2019-07-15T23:52:33Z")

</div>

Something else I tried…

This is rotating shape and updating co-ordinates.  
I had to rotate the PVector of the vertex.

```auto
PShape s;
float theta;

void setup() 
  {
  size(600, 600, P2D);
  s = createShape();
  s.beginShape(QUADS);
  s.vertex(0, 0);
  s.vertex(160, 0);
  s.vertex(160, 160);
  s.vertex(0, 160);
  s.endShape(CLOSE);
  
  fill(0);
  textAlign(CENTER);
  textSize(16);
  }

void draw() 
  {
  background(255);
  translate(width/2, height/2);
// theta += TAU/100;
  for (int i = 0; i < s.getVertexCount(); i++) 
    {
    PVector v = s.getVertex(i);
    v.rotate(TAU/1000);
    s.setVertex(i, v);
    
    text(i, v.x+10, v.y);
    text(v.x, v.x-30, v.y-20);
    text(v.y, v.x+30, v.y-20);
    }
    
    shape(s);
  }

```

🙂

---

_[View the full topic](https://discourse.processing.org/t/i-need-know-vertex-after-rotate/12719)._
