# Triangle movement | Last thread this week

**URL:** <https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191>\
**Category:** Coding Questions\
**Created:** [November 3, 2019, 3:17pm UTC](https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191 "2019-11-03T15:17:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FilDomInteractive](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fildominteractive/32/6678_2.png) [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Post date:** [November 3, 2019, 3:17pm UTC](https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191/1 "2019-11-03T15:17:20Z")

</div>

I Have an ellipse(x, y, 20, 20); and I want it to be a triangle of any parameter, but will still have position x, y so I can move it with my keys. Thank you!!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 3, 2019, 8:33pm UTC](https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191/2 "2019-11-03T20:33:56Z")

</div>

That’s easy

just make a function myTri() and  
say

```auto
void myTri() {
   pushMatrix(); 
   translate(x,y);
   triangle(....) // values so that the triangle **lies on 0,0** , so -30,-30, 30, -30 etc. 
   popMatrix();
}

```
