kalinov's blog

By kalinov, history, 5 years ago, In English

Hey everybody, I wrote an easy-to-use C++ library to visualize or debug problems in the 2D plane. It was written specifically for usage in and around competitive programming, so I though I'd promote here and maybe some of you find it useful.

To get started you download and #include a single file "geodeb.h", and then use simple functions to draw points, lines, circles, etc. When you run the program it generates an html file that displays what your code has drawn, and you can trace the program in an interactive UI through your web browser.

You can watch this demo video to see it in action, or look at the README over at the github page that includes some simple examples. If you're feeling really adventurous, you can take a look at some complex visualizations in the Museum of 2D art.

Let me know what you think, or if anything is broken on your platform or browser. Cheers!

  • Vote: I like it
  • +271
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +17 Vote: I do not like it

I'm actually stunned. This looks amazing.

»
5 years ago, # |
  Vote: I like it +14 Vote: I do not like it

whatever i pass through GD_* it takes it as -0,-0.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    The output tells me that your GD_POINT call is in line 91, so there is no way for me to tell what you're doing wrong in those first ~70 lines that I don't see. Or if you're just trying to prank me :)

    Having said that, I haven't tried it on windows, and though I find it hard to believe that it wouldn't work there, I'll look into it if more people report the same issue.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      I put some newline after running the code to separate the main() from template as I thought it would make a good screenshot. I will tell my other windows users friends to test it out.

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I replicated your code and had the same problem. I'm a Windows user too. I can add a screenshot of the program via edit if requested.

        • »
          »
          »
          »
          »
          5 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          The problem seems to be that I used "%lf" to printf doubles, and that doesn't do the right thing on your platform/compiler.

          I've submitted the fix to GitHub. Please try again, and thanks for reporting the problem.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hello random people down-voting a valid question. Care to explain ?

»
3 years ago, # |
  Vote: I like it +13 Vote: I do not like it

This is a fantastic tool! I always thought it would be difficult to visualize geometry algorithms in cpp. But this makes it so easy! I'm definitely gonna use this.