02-01-2010 10:47 AM
A few pictures may help-- and some clarification
In this frame we see how I chose the arbitrary median of [C] to determine the inner boundry of Orbit point O and its arbitrary starting point. Simply O only needs to be outside the light green circle and point out there will do.
Here I have constructed the "chords of interest" and identified all points on the circle (and some "trivial" points) (in this ex 1 point is trivial (that is inside the circle)
Nex we examine the angles of the chords at the vertices. They will either be obtuse, right or accute If the angle is obtuse (as @2) a circle drawn through them will be too small as seen here (because we have found the smallest circle containing those three points
However If the angle is RIGHT Or accute as seen @1 we can draw the circle though these three points at by selecting the correct origin shown below
The trick to this is that the smallest circle solution must not have all of its points on the circumferance in one hemisphere (except at the special case where excatly two pointsare on the circumference ) . Rotate the top point in [C] CCW on the circumference. the "Chord of interest" rotates rotates CCW at half the radiial velocity and angle 1 becomes more accute BUT, the intesection of the bisecting lines does not change (although at some point a Flip occurs as the point is uneclipsed earlirer in the Orbit)
02-01-2010 10:49 AM
02-01-2010 11:01 AM
RWiersma wrote:Jeff,
Thank you for the informative post. I'm working to make a VI implementation of your notes, as we speak.
And as for a LV implementation----
Ben?
Christian? HELP
02-01-2010 01:06 PM
Perhaps the way to get to this the easiest:
Triangles
Are formed from the points we found.
However, Acute triangles ABD and ACD do meet the the Arc >= pi*r requirement and circles inscribed about Them will define your smallest circle
02-01-2010 07:09 PM
Interesting little problem. During a coffee break I implemented the EH algorithm just for fun. Worked entirely too well from the first time I ran it so something is probably terribly wrong with my trig or the code. Seems to do the job, every once in a while it hangs due to what appears to be a floating point error.
Enjoy. (BTW I used my automatic formula generation code for the circumscribed triangle VI, so that mess is not entirely my fault.)
Algorithm details taken from the original link.
02-01-2010 08:04 PM
Crap,! I sweated my skull off!!!
Darin.K wrote:Interesting little problem.
. During a coffee break I implemented the EH algorithm just for fun.
Worked entirely too well
Pretty Well indeed (bows)
so something is probably terribly wrong with my trig or the code.
In a polar coorodinate plane
Where O = origin
T(heta) = angle
And r= radius
Place points at:
A = r,180
B= r,0
c= r</1/pi/2<0,90
d =-r</pi/2<0,180
Set up : Special case where the distribution is ovoid in along the major axis A-B
Solve:
every once in a while it hangs due to what appears to be a floating point error.
Enjoy.
But- WOW! nice math (seriously)
02-01-2010 10:26 PM
Jeff, I have only scratched the surface of your construction, but my compliments, indeed. It will take a couple of more coffee breaks (and ensuing caffeine rush) to get my brain around it. For the classic algorithm, a lot of the work is already done, but there still are a few tasks which are much easier put into words than LV expressions. "Extend the diameter through point X and choose point Y or Z which is in the opposite half-plane of Point W..."
I wish I had these posts on my recent plane trip, it would have been great fun to work through with only pen and paper. As for your willingness to sweat your skull off over this problem, you have my utmost respect.
02-02-2010 09:06 AM
Darin-
Your implementation of the EHA is brilliant! Your code in NewPoint.vi is well done.
My version of the program looks similar for steps 1-3, but yours is far more clean and tidy than mine.
I was stuck on Step 4, building the PL and R points.
Specifically, my learning experience came from searching an array for Max (or Min). After seeing this, it seems so elementary. I kept putting the arrays into for loops, and keeping a water mark and recording the (i) at the same time. What a waste of time!
Thank you for your hard work!
Jeff-
Your efforts put into this situation are highly appreciated, and commendable. I have to admit, I was pulling out old textbooks to remember the first thing about polar coordinates! 🙂
I attempted to implement your logic several different times, but I think my major confusion was trying to work in radians, when I don't have a solid understanding of them. I use degrees for everything in my line of work, and it was my own inflexibility that brought me down, here.
Thank you very much for your skull-sweating 🙂
02-02-2010 10:36 AM
All points (x,y) on a circle that is centered at the origin obey the relationship x^2 + y^2 = r^2, where r is the radius. If the center of the circle is at xo,yo, then the points obeys the relationship (x-xo)^2 +(y-yo)^2 = r^2. If you have three points, (x1,y1), (x2,y2), and (x3,y3), you have three equations:
(x1-xo)^2 + (y1-yo)^2 = r^2 Eq1
(x2-xo)^2 + (y2-yo)^2 = r^2 Eq2
(x3-xo)^2 + (y3-yo)^2 = r^2 Eq3
and three unknowns xo, yo, and r.
Therefore, with three points, the circle is completely defined and r can be solved uniquely (ignoring neqative values for r). If you have more than 3 points, you can not be assured that they all fall on a circle. If you have only 2 points, the smallest circle that can be drawn through both is the circle with the diameter equal to the distance between them.
The algebra to find r from 3 points is tedious but straight-forward. Just set the left side of Eq1 to the left side of Eq2, eliminating r^2. Then you can solve for xo in terms of yo and known values. Then do the same for Eq2 and Eq3 and solve for yo in terms of xo. Substitute the value for xo found previously into this latter equation and you have your answer for yo. If I didn't make a mistake, it should look like
yo = {y3^2 - y2^2 + x3^2 - x2^2 + (x2-x3)*(x2^2 - x1^2 + y2^2 - y1^2)/(x2 - x1)}/{2 * [(y3 - y2) - (x2 - x3)*(y1 - y2)/(x2 - x1)]}
Then you just substitue this into the previous equation to get x0 and finally substitute both the values for xo and yo into any of the original equations to get r.
02-02-2010 11:09 AM - edited 02-02-2010 11:10 AM
Darin,
The weakness of my approach lies in determining the trivial Points. in this example, Points C and D are "trivial" in that they form the obtuse angles ACB and ADB. And thusly they do not define the circumference. Although, it would be easy to construct an example where a "Trivial" point IS on the circumferance, the circle would be described sufficiently by the remaining points hence if ANY point forms any obtuse angle it can, and should, be dismissed from further analisys.
Your
implementation DOES solve for this special case. My gut analisys last
evening suffered from lack of proper investigation. Your methodology of
bisecting a triangle in "Circle from diameter.vi" is Briliant! (but
really needs some documentation
I now suspect your occasional "hangs" are related to the approach your use in step three at Acute Triangle.vi. While I tested a few cases where the origin lies in line with two points and did not observe any "hanging", I suspect the dissmissal of right trianlges may be your culprit. Rightness is Very difficult to determine in a cartisean system limited to DBLs. If you have any examples you've seen hang please post them. Another possibile culprit is in Step two. I suspect there could be cases where two identical points (or two points with identical "Max Distances" found from Check Points.vi) could infinetely swap back and forth between index 0-2.
The only (ERROR?) I have found is the special case where Index[C]=1 :r=0 is correct in that a circle of "no" size contains a point however, Xc =0and Yc=0 places the null circle in the wrong location. Xc=X[0] and Yc=Y[0] in this case.