1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finding the center of an n-gon (circle) based on angle and side-length

  1. Jan 7, 2013 #1
    I hope this is self-evident to someone, i'm struggling.

    I have a program that draws circles (n-gons really) of various sizes, but by translating-rotating-translating-rotating-..., not by x=sin/y=cos. That works as intended, but my wish is to offset the circle so that its center is (0,0) in the coordinate system. For that i need its center. Currently the circle itself originates from- and hence touches the (0,0) coordinates, so its center is somewhere above, in the y-axis.

    dsrd0.jpg

    Position of ? is sought after. A wider angle would result in ? rising for instance.

    I found lots of tutorials on how to do it on paper using dividers and i also considered that it's a isosceles triangle, but it seems all textbook examples assume that one of the symmetric sides is already known.
     
  2. jcsd
  3. Jan 7, 2013 #2

    jedishrfu

    Staff: Mentor

    you could use similar triangles and some trig to get the radius along the y-axis.

    Notice you can extend a perpendicular bisector from the first n-gon side which intersects the y-axis

    so that 1/2 the n-gon side is the short edge the perpendicular creates the right angle and the y-axis is the hypotenuse.

    This triangle is similar to the one formed by the n-gon edge and the x-axis.

    So I get something like:

    radius along y-axis = (1/2 n-gon side) / sin theta
     
    Last edited: Jan 7, 2013
  4. Jan 7, 2013 #3
    Yes, you're right. After some more reading and pondering i came to this solution:

    [itex]\alpha =[/itex] angle in degrees
    [itex]s =[/itex] segment length

    To get the inner angle between the sides, we subtract from a half-circle. We then divide by two, to get the inner angle of the isosceles triangle:
    [itex]\beta = (180 - \alpha) \div 2[/itex]

    degrees to radians:
    [itex]\phi = \beta\times\frac\pi{180}[/itex]

    Distance to center point can then be gotten from [itex]s\div 2 * tan(\phi)[/itex].

    Edit: Just saw you extended your reply, oh well :)
     
  5. Jan 7, 2013 #4

    jedishrfu

    Staff: Mentor

    Glad you figured it out.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Finding the center of an n-gon (circle) based on angle and side-length
Loading...