Results 1 to 4 of 4

Thread: Radius

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448

    Radius

    If I draw a circle on a form, how would I be able to find the X, Y (Better yet, TOP, LEFT) of a particular point on the circle? I would like to animate something following that path, but I don't remember geometry very well and don't know exactly how to convert that point to coordinates on the form.

  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    48
    Divide the circle into 4 quadrants.

    Using the radius of the circle as the hypotenuse of a right
    triangle, use trig to calculate cos & sin distances.

    Add or subtract these distances (depending on the quadrant)
    to the center of circle coordinates.

    Good luck

  3. #3
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357

    well...

    ...we don't exactly understand what you mean.

    points (x,y) on a circle satisfy the equation:
    x^2 + y^2 = r^2
    where r is the radius of the circle.

    If you are trying to animate something then:
    1. Draw the circle
    2. Find its radius somehow (I assume you can work this out from the co-ords when you draw the circle)
    3. Let x range from lowest value to highest value and solve for y.
    There are 10 types of people in the world - those that understand binary, and those that don't.

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Heres one way:

    Given Radius Ro, Origion Xo, Yo, and you want to find Xn, Yn, at angle Ang, then:

    Xn = Xo + Ro*Cos(Ang)
    Yn = Yo + Ro*Sin(Ang)

    And, if you use radians, you get a complete circle as Ang goes from 0 to 2*pi.

    -Hope this helps
    -Lou

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width