Computer Science Canada Customized Circle Drawing |
Author: | Cezna [ Tue Jun 08, 2010 11:12 am ] | ||
Post subject: | Customized Circle Drawing | ||
This is a program I made to draw a circle, without using the drawfilloval procedure. I didn't make it into it's own procedure, but it would be very easy to do (if anyone wants to, feel free). This is mostly just an exploration into how to use the math behind circles in Turing. All of the variables are up at the top and easy to change, and I think I commented it enough to allow it to be understandable. If anyone likes it, please post back and let me know. ![]()
There's also a version that fades the colour as it goes from left to right, which I have posted as an attachment as I figure not as many people will care about it once they have seen he first one, so I am trying to keep my post size small. |
Author: | copthesaint [ Tue Jun 08, 2010 11:27 am ] | ||
Post subject: | Re: Customized Circle Drawing | ||
Not trying to discourage you or anything, but this really isnt worth posting, since the same thing can be done with
which is 1000* faster, and even this should not be used... if you have to draw a circle just stick to the predef ![]() |
Author: | Cezna [ Tue Jun 08, 2010 11:40 am ] |
Post subject: | RE:Customized Circle Drawing |
The first part does make me feel like a fail ![]() But as for the predef, this was just an exploration into the math behind circle drawing.... and at that it seems to have been a failure. |
Author: | chrisbrown [ Tue Jun 08, 2010 12:54 pm ] |
Post subject: | RE:Customized Circle Drawing |
Failures are just learning opportunities. You won't find better methodologies until you first explore the ones that make sense to you. |
Author: | Cezna [ Tue Jun 08, 2010 5:09 pm ] |
Post subject: | RE:Customized Circle Drawing |
Thank you chrisbrown, I suppose you're right. At least mine draws it slowly if the x changes slow enough, that's kinda cool... Well, maybe not so much |
Author: | copthesaint [ Tue Jun 08, 2010 7:58 pm ] |
Post subject: | RE:Customized Circle Drawing |
Discovery channel ![]() ![]() |
Author: | Cezna [ Wed Jun 09, 2010 7:58 pm ] |
Post subject: | RE:Customized Circle Drawing |
Alright, I am feeling a little better about my attempt now. Thanks again for the simplified version copthesaint. |
Author: | DtY [ Wed Jun 09, 2010 8:49 pm ] | ||
Post subject: | Re: Customized Circle Drawing | ||
copthesaint @ Tue Jun 08, 2010 11:27 am wrote: Not trying to discourage you or anything, but this really isnt worth posting, since the same thing can be done with
The problem with this is that it will only draw 360 dots, drawing 360 dots around a point in a circle does not make a circle, unless the circumference of the circle is less than 360px (with the possibility that some points will end up on the same spot, due to round off problems), which means that you can only use this to draw a circle that is less than ~58px in radius.
which is 1000* faster, and even this should not be used... if you have to draw a circle just stick to the predef ![]() A better solution would be to draw lines between each of the dots, which would at least always draw a closed shape, but would look like a polygon if it was big. There's probably a formula to figure out how many sides need to be drawn to create a decent looking circle. I actually wrote a program a while ago that would draw a circle (in C, into a 2D array, saved as an XPM) by iterating over every pixel on the canvas, and changing the colour if the distance between it and the centre was less than the circle radius. |