locked
ellipse divided into angles

    Question

  • Hi,

    I want some ideas to divide an ellipse into n number of angles in windows store app using xaml and c#.

    thanks in advance.



    Monday, March 3, 2014 12:22 PM

Answers

  • Id' use something like :

    dx = line_length * cos(radians(angle))
    dy = line_length * sin(radians(angle))

    I guess just divide 360 by the number of items, and that would be your angle.  dx and dy would then be the edge of the circle where your item is drawn.

    If you have an ellipse, multiply the line_length for one of the terms (dx or dy) by the ellipses height to width ratio as appropriate for your ellipse.


    Darin R.

    Monday, March 3, 2014 10:34 PM

All replies

  • Meaning what exactly? I can give you a hundred different ways to do this but you haven't stated what you're trying to achieve.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 3, 2014 1:24 PM
    Moderator
  • OK,  what exactly I need is, I have to set n number of images on the circumference (outer ring) of the ellipse and it should be such that all the images sits in equal distance. 

    So wanted to divide the ellipse into some angles. Pls suggest if any other solution .

    thanks.

    Monday, March 3, 2014 1:48 PM
  • Id' use something like :

    dx = line_length * cos(radians(angle))
    dy = line_length * sin(radians(angle))

    I guess just divide 360 by the number of items, and that would be your angle.  dx and dy would then be the edge of the circle where your item is drawn.

    If you have an ellipse, multiply the line_length for one of the terms (dx or dy) by the ellipses height to width ratio as appropriate for your ellipse.


    Darin R.

    Monday, March 3, 2014 10:34 PM