Results 1 to 3 of 3

Thread: Calculating x & y for a specific position on a circle

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Christchurch, New Zealand
    Posts
    12

    Exclamation

    Hi I was wondering if someone could help on this:

    I have an imaginary circle on a form with 16 buttons layed out around the circle at even intervals.

    I want to make some code to specify the position of each button. How do I calculate the specific x and y position of a point on a circle?

    Thankyou

  2. #2
    Junior Member
    Join Date
    Jan 1999
    Location
    Q.C., Phils.
    Posts
    27
    You need a radius and the angle of inclination relative to the center of the circle.
    y = r * sin á
    x = r * cos á
    á is the angle in degrees

    Using the sin, cos, tan in VB requires the parameter to be in radians. to convert degrees to radians, multiply the value with pi/180 (pi= 3.141592654).
    Share your knowledge, it is the best way to achieve immortality

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Christchurch, New Zealand
    Posts
    12

    Wink

    Thankyou it works perfectly

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