Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to draw a sector of a circle?

how to draw a sector of a circle?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tho_mee
    wrote on last edited by
    #1

    the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.

    A A E I 4 Replies Last reply
    0
    • T tho_mee

      the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.

      A Offline
      A Offline
      Avi Berger
      wrote on last edited by
      #2

      I would imagine that you have enough information to calculate the bounding rectangle.

      Please do not read this signature.

      1 Reply Last reply
      0
      • T tho_mee

        the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.

        A Offline
        A Offline
        Adam Roderick J
        wrote on last edited by
        #3

        As mentioned above, you got all the information needed. Now its time for mathematical calculation. Now i cannot understand, what's the hurdle in front of you to do that calculation :doh:

        Величие не Бога может быть недооценена.

        1 Reply Last reply
        0
        • T tho_mee

          the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.

          E Offline
          E Offline
          Eugen Podsypalnikov
          wrote on last edited by
          #4

          Please observe this formula to find the distance between two points[^] :) Now you could find the radius (R = d) of your circle: P1(x1, y1) - center point, P2(x2, y2) - start point Then you could determinate the rectangle (rc) :) : rc.left = x1 - R; rc.top = y1 - R; rc.right = x1 + R; rc.bottom = y1 + R;

          virtual void BeHappy() = 0;

          T 1 Reply Last reply
          0
          • T tho_mee

            the three points ( center, start of arc ,end of arc) and the angle are known to me. I need to draw whenever these values are given. I saw CPie but for that you need to know the rect.

            I Offline
            I Offline
            Iain Clarke Warrior Programmer
            wrote on last edited by
            #5

            Arc[^] AngleArc[^] ArcTo[^] Enough for you? Ellipse and Arcs in GDI+[^] I'd also look at GraphicsPath in GDI+ before. That way, you can "draw", and then break that into it's points. I hope that came close to an answer for you. Iain.

            I have now moved to Sweden for love (awwww).

            1 Reply Last reply
            0
            • E Eugen Podsypalnikov

              Please observe this formula to find the distance between two points[^] :) Now you could find the radius (R = d) of your circle: P1(x1, y1) - center point, P2(x2, y2) - start point Then you could determinate the rectangle (rc) :) : rc.left = x1 - R; rc.top = y1 - R; rc.right = x1 + R; rc.bottom = y1 + R;

              virtual void BeHappy() = 0;

              T Offline
              T Offline
              tho_mee
              wrote on last edited by
              #6

              thank you . My idea of bounding rectangle was wrong. Anywayz hankz for the very precise answer. :-)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups