Well, to draw an equilateral triangle, the outer loop has only 3 iterations and you rotate the direction 120 degrees between segments.
Also, drawing a circle is trivial using complex numbers. Here's how you make a circle.

im not wanting to create a triangle i already have i want to take out the code i was previoulsy using in the attachment below and add in the code you help me to create to draw the rectangle.
if that makes sense?
anyone got any ideas?
@recneps wrote:
anyone got any ideas?
Yes.
Try to make the code universal so you only need to enter the side length and number of corners. Very little change needed.
(Posting by phone. No computer here...)
Changing the code that you helped me with? or to a different part of the code
im not having trouble drawing the shape just making it connect to the same graph.
Why are you turning it into a 3D array using autoindexing?
If you want the dot to move, the graph terminal belongs inside the inner loop.
are you on you computer now or still on your phone? i can send you what i have done so far so you can see for yourself what ive done so far and have a mess about with it
OK, as a fisrt step, you need to simplify!
Here is a simple code that graphs a circle permanent and traces a polygon with any number of sides using a moving dot.
(It is NOT complete. You still need to tweak the starting positions and segment sizes with respect to the circle, but that's just simple math.
)

is this a step that needs to be done so that i can put it with all the other code for the circle and triangle so that it plots it on one graph or is this a different exercise?