# Circle functions?

Attention Topic was automatically imported from the old Question2Answer platform.
Asked By C:\Flavius

Hi, everyone!

I’m a high school student, and my maths teacher told me I had to make a monograph, so I decided to use my “skills” in programming to make an application that lets you draw epicycles using circular arcs, and write the monograph explaining what an epicycle is and how this software works.

It will be a simple program that lets you set a value for the colours, number of segments the circle will be divided into, and type of epicycle you want to draw.

I read the documentation and found functions to draw circles, circular arcs and arc plygons. I used the draw_circle() function to draw a purple circle on the middle of the screen but it is all full of purple, but I need it to be just the circumference, not a whole circle and I ould need it not to be only one pixel thick.
Of course, I could draw_circle_arc()s with 0 to 360 degrees of arc, and repeat this with radius, radius-1 and radius+1 but is there a more elegant way of doing this?

Also, if you wish to help me, I would be really grateful if you told me every draw_circle() related functions, as I wasn’t able to find a function that lets you draw a circumference with x thickness.

Thank you in advance!

Edit: Also, is there a way to get coordinates using the polar notation of a vector (magnitude, angle) using the centre as the origin? This way I could easily divide the circle into n segments to use their coordinates to draw the epicycle.
I mean, polar notation example: 50 [subscript] 45 where 50 is the length (module) of the vector and 45 (written as a subscript) is the angle or orientation.

I hope this isn’t confusing…
Edit3: This vector or line shouldn’t be drawn, I just want to use it to get a point or coordinate which I’ll use later.

Edit2: I already did the “draw a circle arc from angles 0 to 360 thrice but changing the radius to radius-1 and radius+1 to make it look thicker” thing.
It looks horrible.
I really need a function to allow me to change its thickness.

Have a nice day

Reply From: Zylann

You can draw a circle with `draw_polyline` in a for loop, which can have a customizable thickness (so you won’t need to draw every radius). You can also do that with a `Line2D` node, on which you set the coordinates of the arc points, with a bit of trigonometry.

Thank you very much! That’s exactly what I needed.

C:\Flavius | 2018-04-24 16:31