cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the circle to draw a rectangle rather than a line?

altenbach
Knight of NI

Re: How to get the circle to draw a rectangle rather than a line?

Message contains an image Message contains an attachment

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.

 

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

Message contains an attachment

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?

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

anyone got any ideas?

altenbach
Knight of NI

Re: How to get the circle to draw a rectangle rather than a line?


@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...)

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

Changing the code that you helped me with? or to a different part of the code

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

Message contains a hyperlink

im not having trouble drawing the shape just making it connect to the same graph. 

http://gyazo.com/208c1ae4d236b502f94ea8c584725931

altenbach
Knight of NI

Re: How to get the circle to draw a rectangle rather than a line?

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.

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

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

altenbach
Knight of NI

Re: How to get the circle to draw a rectangle rather than a line?

Message contains an image Message contains an attachment

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. Smiley Very Happy)

 

recneps
Member

Re: How to get the circle to draw a rectangle rather than a line?

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?