5 kyu

Graphics 02: Drawing Circles

Description
Loading description...
Graphics
Algorithms
  • Please sign in or sign up to leave a comment.
  • Droppy Avatar

    Further documentation of the API: x and y specify the center of the circle.

  • dcieslak Avatar

    Approved!

    • smile67 Avatar

      Thanks again;-)! Really hard-working:-)...

    • dcieslak Avatar

      Your Graphics series look quite unique and intersting. I guess it's worth to approve them ;P I will check also the rest when I will find some free time.

    • smile67 Avatar

      About 2 years old, almost my first tries for publishing katas, so not really "perfect code" (today i would do some things different);-)... So good luck and thanks for your approvals!

    • dcieslak Avatar

      You could refactor your code if you are ashamed :P But from the other hand a wise man says if it's not broke, don't fix it.

    • smile67 Avatar

      It's not really necessary i think - good old time... first steps... memories... :-)

  • aryan-firouzian Avatar

    This comment has been hidden.

    • smile67 Avatar

      Hi, long time ago, hope you are well;-)... the problem is not the rounding, but the condition 'The circle has to be "complete", no single points with gaps between.' (see end of description). Your solution has too much gaps between single points (some are ok, because of my "rounding" max. two). So your steps between points should be smaller, especially for the third testcase with a big radius. Hope it helps, should be easy to do some little changes;-)!

    • smile67 Avatar

      PS: If you need a concrete hint what to change in your code, tell me (you are close to solve it, your solution generally works);-)...

    • aryan-firouzian Avatar

      Thanks, I got the point and submited the final solution.

    • smile67 Avatar

      This comment has been hidden.

  • myjinxin2015 Avatar

    This comment has been hidden.

    • smile67 Avatar

      This comment has been hidden.

    • smile67 Avatar

      This comment has been hidden.

    • myjinxin2015 Avatar

      I can't see what are you said ,because : "This comment has been hidden."

    • myjinxin2015 Avatar

      Hmmmmm...I'll try it later,I'm hungry now...

    • smile67 Avatar

      Ok... sorry, forgot that you haven't solved it, so you can't read it... Try it again and it should work... you will find my explanations after completing the kata, but here you can see the difference:
      Difference (your circle is on right side)
      Part of my answer was: I can see an incomplete part of your circle, a linepart where y is 50 at the bottom of the circle, perhaps the clipping is wrong for 1 pixel (it's a circle at 50,25 and radius 25 which means complete canvas height). The output of the testcase 2 shows this difference (some "DDDDDDD's" at the bottom, little bit to the right). All the other tastcases were ok... The testcases compare both images yours and my image, so my solution "deletes" every pixel and around +/-1 inside your image, but your pixels do not delete every pixel inside my image - because the complete linepart is missing which causes this deleting.

      So enjoy your meal;-)!

    • smile67 Avatar

      Again one hint, tested your solution with my random tests (Submit- Button)... and there's often an extra point missing, so your solution isn't accepted... perhaps you change your rounding (and it's necessary to combine all the points on the circle, single points with gaps between are not enough!)? I enlarged the "delta" from +/- 1 pixel to +/-2 pixel around my solution points (only for circles and ellipses, lines at +/- 1 point)... but your solution doesn't work on every random test (normally one point missing or too much?!)