Results 1 to 5 of 5

Thread: Equidistant points along a QGraphicsEllipseItem

  1. #1
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Thanks
    16
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Equidistant points along a QGraphicsEllipseItem

    Hello,

    Is there anything in Qt that would enable me to calculate equidistant points around an instance of QGraphicsEllipseItem?
    I thought the QGraphicsEllipseItem implementation might shed some light on the problem.

    Please forgive if this is more of a math / computational geometry forum question (e.g. answer being to use elliptic integrals).
    Nonetheless, many thanks for suggestions that come to mind.

    Thanks,
    Ben

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Equidistant points along a QGraphicsEllipseItem

    Equal distance along the circumference, equal subtended angles at the centre, or even equal angles at a focus of the ellipse?

  3. #3
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Thanks
    16
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Equidistant points along a QGraphicsEllipseItem

    Equidistant points along the circumference of the ellipse ... not equal angles. Near equidistant points would even suffice.
    This is not a trivial computation for an ellipse, so I was hoping Qt provided some solution since they obviously render the ellipse properly.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Equidistant points along a QGraphicsEllipseItem

    Unfortunately, drawing an ellipse using a Bresenham-style algorithm is much easier than computing the circumference. The Qt arc functions all work on the central angle if memory serves.

    For a near circular ellipse equal angles would be a close approximation. There may be some method using equally spaced points on an auxiliary circle and then mapping them back to the ellipse but I cannot point to it. Something like that happens in the Vincenty methods for working with an ellipsoidal world: the geometry is mapped to an auxiliary sphere, maths done with spherical geometry, and an iterative method used to return to the ellipsoid. You would need the equivalent of the last step.

  5. #5
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Thanks
    16
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Equidistant points along a QGraphicsEllipseItem

    Thanks much for the feedback. Elliptic calculations aren't generally closed form.
    When I get the elliptic integral solution working I'll post the example here if any are interested.

Similar Threads

  1. Signals and slots for QGraphicsEllipseItem
    By Cruz in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2014, 15:51
  2. Replies: 2
    Last Post: 2nd May 2012, 09:49
  3. QGraphicsEllipseItem
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2009, 08:48
  4. text inside QGraphicsEllipseItem
    By stoned in forum Qt Programming
    Replies: 3
    Last Post: 10th June 2008, 07:44
  5. QGraphicsEllipseItem with Handles
    By stevel in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2008, 00:00

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.