# Sierpinski Triangle Question (very quick)

Jonny Carterson

Greenhorn

Posts: 2

posted 3 years ago

Hello, I am stuck at a part in this triangle creation. I need to add X from the random to X from the last point in the arrayList and add Y from the random to Y from the last point in the arrayList. I tried using "getX()" and "getY()" to try to get the coordinate from the arraylist, but I am having no luck.

I am stuck and don't know how to get the index of the last X coordinate or the Y coordinates.

So pretty much this is my trouble (as in I know how to get new random points, but how do I add these new x and y points to the last point and then divide them in half?):

I am stuck and don't know how to get the index of the last X coordinate or the Y coordinates.

So pretty much this is my trouble (as in I know how to get new random points, but how do I add these new x and y points to the last point and then divide them in half?):