Блог пользователя kalinov

Автор kalinov, история, 5 лет назад, По-английски

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!

  • Проголосовать: нравится
  • +271
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

I'm actually stunned. This looks amazing.

»
5 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

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

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    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 лет назад, # ^ |
        Проголосовать: нравится +13 Проголосовать: не нравится

      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 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        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 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          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 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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

»
4 года назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

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.