Results 1 to 4 of 4

Thread: [Resolved] Finding Min X on a circle

  1. #1

    Thread Starter
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Resolved [Resolved] Finding Min X on a circle

    How is it possible to find the minimum X coordinate on the circle between the two lines?
    Y1, Y2, R are known. The centre of the circle is at (0, 0)

    In the picture the MinX would be –R, but the boundary lines can be placed anywhere in the circle, they are always parallel with the X axis.

    Thanks

    Robert
    Attached Images Attached Images  
    Last edited by THEROB; Jan 16th, 2007 at 07:26 AM. Reason: Resolved
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Finding Min X on a circle

    Just check the values of Y1 and Y2. There are only 3 possibilities:

    One >= 0, one <= 0 as in your picture - in this case the minimum must be -R because the lines enclose the overall minimum point at 180 degrees.

    Both >= 0 - in this case the minimum is at Y2. Since you know R and the value of Y2, you can easily work out the X value by Pythagoras or trig.

    Both <= 0 - as above, except that now the minimum is at Y1.



    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  3. #3
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Finding Min X on a circle

    Quote Originally Posted by THEROB
    How is it possible to find the minimum X coordinate on the circle between the two lines?
    Y1, Y2, R are known. The centre of the circle is at (0, 0)

    In the picture the MinX would be –R, but the boundary lines can be placed anywhere in the circle, they are always parallel with the X axis.

    Thanks

    Robert
    Well, if (Y1 - R)*(Y2 - R) <= 0 then the 2 lines are on opposite sides with rerspect to the x axis, so the min. x coordinate is -R as in your example.
    Otherwise, let H = Min[Abs(Y1),Abs(Y2)], i.e. make H the distance between the origin and the closest of those lines. Then you find the negative x coordinate of the intercept with the circle.

    Equation of the circle:

    X2 + y2 = R2

    Substitute y by H:

    X2 + H2 = R2

    so that the required minimum x is:

    Xmin = -Sqr(R2 - H2)
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4

    Thread Starter
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Finding Min X on a circle

    Thanks thats really helped me out.

    Robert
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

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