Click to See Complete Forum and Search --> : [Resolved] Finding Min X on a circle
THEROB
Jan 16th, 2007, 04:38 AM
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
zaza
Jan 16th, 2007, 05:40 AM
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
krtxmrtz
Jan 16th, 2007, 05:47 AM
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)
THEROB
Jan 16th, 2007, 06:26 AM
Thanks thats really helped me out.
Robert
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.