Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Find circle radius & circle center in 3D from (3) XYZ pts 5

Status
Not open for further replies.

DrMetal

Materials
Oct 4, 2005
30
0
0
US
GIVEN: X-Y-Z coordinates of 3 points in 3D space. FIND: Radius of circle on those 3 points & Circle center co-ordinatesBookmark:
Question: Can someone provide a mathematical step by step procedure to calculate and determine a circle radius and the center point coordinates from three GIVEN 3D points with X-Y-Z coordinates?

- I have searched the web extensively, and found lots of proposed solutions, but my college math is quite rusty and after several days, I still can not come up with the correct detailed solution. I can do this easily from three points in 2D, in Excel using three simultaneous equations with TWO variables (i.e. find circle center @ h, j). But I can't get it to work in 3D with a similar spreadsheet approach with THREE variables (i.e. find circle center @ h-j-k). Seems I keep going in mathematical circles (no pun intended) with a modified Excel approach with the three quadratic equations.

- Is it possible to solve this mathematically with (3) simultaneous quadratic equations? Or do I need a 4th equation, determinates, etc?. Seems when I try the double elimination (or substitution) of variables approach, I keep coming up with unsolvable, or meaningless equations. With as much time as we have spent on this problem, we would be happy to compensate someone for their time to solve this for us.

- We have several drawings with bent pipes in 3D where we have only THREE 3D points given to us. We need to be able to determine the TRUE bend radius of the pipes. These are special alloy pipes @ $25k each, so we want to be sure we have the correct 2D bend radius before we bend them. I'd prefer an approach that could be put into a spreadsheet to make reiterative calcs go quickly. I'd prefer to have a detailed step-by-step solution vs. being directed to one of the web solutions. I have seen most of them, and still am stuck on this.
Thanks, MWP
 
Replies continue below

Recommended for you

I'm not entirely sure that method will work

First use the 3d points to define the plane, then on that plane use the same 3 points to define the circle.

Note that you haven't beaten the requirement that it takes 4 triads to define a sphere, as this merely finds a section through an infinite number of spheres.



Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
DrMetal,
Sounds an interessting and challenging problem. Are the three points given always the same three points on the arc i.e are they always 45deg apart or some other known constant? This may be the way to simplify the solution into a planar (2D) problem.

Mark Hutton


 
A question more than help, perhaps, but:

I presume that all bends that you want to determine are bends in one plane, and that the points given are points on the bend radius in that plane?

If you then first determine the plane and find the xy coordinates for the three points in that plane you should be able to go back to your 2D solution.

Are all the bends 90 degrees?

 
Probably your simplest, fastest solution: plot these three {X, Y, Z} points into a CAD package, put a spline through them, and then use the CAD package to measure the spline. I know this would work with AutoCAD or SolidWorks or Alibre.

ANALYTICALLY:
A circle is a planar geometrical object, so you must resolve your 3D curve to 2D.

From my CRC Standard Math Tables 26th Edition (Analytic Geometry)

3-point form {x1,y1}, {x2,y2}, {x3,y3}:

solve the simultaneous equations matrix:

| (x^2 + y^2) x y 1 |
| (x1^2 + y1^2) x1 y1 1 | = 0
| (x2^2 + y2^2) x2 y2 1 |
| (x3^2 + y3^2) x3 y3 1 |


If you're still stumped, go to the library and check out a CRC math book...it's all in there.


TygerDawg
Blue Technik LLC
Virtuoso Robotics Engineering
 
it's as "simple" as greg posts ... 3 non-colinear pts define a plane, transform the xyz co-ords of the three points into the new co-ord system (with (x1,y1) in plane and z1 out-of-plane. then 3 planar non-colinear pts define an arc.
 
there are tons (or tonnes in europe) of excel sites (xcalcs.com, mrexcel.com, excelcalcs.com, wiki) i'm sure you can find something to determine the transformation matrix for a plane given three points (a hint ... make one point the origin, one axis is from pt1 to pt2, the 2nd axis is normal, the 3rd axis is out-of-plane (and redundant); so now you have the new planar co-ords for the 3 points (one being (0,0), the other being (x,0), ...) again there are many available solution for an arc thru 3 pts.

of course, you could put the three co-ords into Auto-Cad and it'll solve this for you ...
 
a few more comments.

If you have "several" and each is ~ $25k, your time spent on trying to get Excel to work might be better spent just modeling the parts up, and obtaining the h-j-k co-ordinate if this is indeed a requirement at all.

I've done some tubing modeling in both AutoCad & SW where the 3D points are given for every transition from straight to bend, and back to straight; each bend having a unique value not explicitly given, but geometrically correct.
(All bends being tangent to the straights)

None of this is in reference to a sphere.

It goes rather quickly, once you get onto it.

 
I think what you are trying to quantify is called a ‘great circle’. If I get the picture, your section of pipe is bent to constant radius whose center lies in the plane defined by 3 known points on the pipe.

For an analytic solution, four equations are needed. Expanding on the previous posts, there are the three obvious equations plus a fourth that constrains all points to a plane. I skipped the tensor transforms and tried setting up something in 4eqns/4unkn. Here's a draft but be forewarned, its ugly. Maybe you can use it (or lose and go the CAD route).
 
 http://files.engineering.com/getfile.aspx?folder=97e766e3-f322-4623-a859-842f9bee0cdd&file=Great_Circle.pdf
In 2D: for points A, B, and C, the center of the circle would be the intersection of the bisector of any two: AB, BC, AC.

In 3D:
The center is on plane ABC.
The center is on the bisector planes of segments AB, BC, AC (you would only need two of these planes).
The center of the circle is at the intersection of three planes: ABC, bisector of AB, and bisector of BC.

[bat]Honesty may be the best policy, but insanity is a better defense.[bat]
-SolidWorks API VB programming help
 
This is not that different than the GPS position solution. However, since knowledge of absolute time is not needed here, you shouldn't need 4 pseudoranges.

There are 3 unknowns, so only 3 equations should necessary. However, pathological configurations of the 3 points amy result in a poor solution.

Have you tried to structure the three 3D distance equations from the center, and have Excel solve for when all 3 distances are equal? You don't, at this point, really care what the equation of the sphere looks like, you simply need to find the center.

However, as with GPS, you could get a poor geometrical dilution of precision, particularly if the 3 points are clustered within a small portion of the sphere.

TTFN

FAQ731-376
 
First off, 3 points in space do not determine the surface of a unique sphere. You need 4 non co-planer points.
The center is found by first finding the plane that is the bisector of any two points,say point 1 and point 2. Then find the plane of the bisector of point 2 and point 3. Now since the intersection of these planes is a LINE and EVERY point on that line is equidistant to the 3 points so that, there is no unique center and therefore no unique sphere. Now you need a 4th point in space to determine that unique sphere. You get it obviously by finding a 3rd plane that bisects the line from that 4th point to any of the other points; the intersection of the 3 planes so formed is the center. which solves your problem. You get it by writing 4 equations:
(X-Xj)^2 +(Y-Yj)^2+(Z-Zj)^2=R^2, for j=1,2,3,4
where
X,Y,Z are the unknown coordinates of the sphere center
and R is the unknown radius.
4 equations and 4 unknowns should get the solution unless the 4 points are co-planer.


r

where
 
Gents .. lots of responses here ... all good info. Just to clarify on some of the issues / questions.

1) I know we need 4 points to define a sphere. But we are not looking for anything spherical. We are only looking for a radius and the ceenter of that radius, as determined by the three XYZ defined points (non-colinear).

2) The 3 pts do define a triangle on a plane. The three points of any triangle will lie on a unique circle.

3)My primary focus was to see if anyone had a mathematical (vs. geometrical) solution that could be put into a spreadsheet. As I stated in my 1st post ... my college math is quite rusty. That's probably why I was having trouble coming up with the math way to define the planes, bisectors, and then solve the problem. I think I am close with the simultaneous equations, but as someone stated above, I think I need one more point to make the 4th equation.

4) More clearly, the points we are given are totally random points in 3D space from some a common set of XYZ axes with 0,0,0 origin. The three points for each pipe are given:
Pc (starting point of curvature, tangent to the bend centerline, and the next straight section),
Pt (Ending point of the curved section, tangent to the bend centerline, and to the next straight section), and
Pi (point of intersection of the two tangents above)

The curved section is a constant radius (once transformed into a 2D plane). Out of plane view, it is a slight ellipse, or a straight line (if viewed parallel to the planar view.

- After bending, the pipe is tilted, offset, and rotated into positon to put the 3 points into proper position. Then, these are welded to large fabrications, that are shipped 3000 miles away. And the end points have to mate up excactly to someone elses pipe work, using the same drawings.

- The arc lengths and arc angles vary from pipe to pipe.

- I am sure that this be done graphically in Solid Works, but them I have no way to mathematicallly verify my CAD guys work is dimensinally correct.

- Lots of comments about this being a 2D planar solution ... and it is, but I don't know how to convert the 3D points into a 2D plane. THis is kind of what I commented on in my first post ... rusty math that is.

- How is the plane mathematically "defined" by the three
points? I can probablly find this ok.

- I think I have my old college CRC book ... good suggestion .. I will look at that also.

Willedawg ... I had already found that mathforum site, and had studied that particular solution .. but was still a little fuzzy on that onee. Seems more complex than it needs to be ... but we are not trying to define a sphere.
I will pass your info to my SWks guy ... we don't have ACAD.

rb1957 ... that Engr.com link apppears to be for integer solutions, and only in 2D. I don't see the relevance. However, the Engr.com link from Bestwrench appears to give me the 4th equation I was missing to plug these into a simple simultaneous equation solution in Excel. I will play with that one too. I did a ton of google searching and never hit on the Engineering.com site (not sure why).

Zekeman ... again, I am looking for the circle, not the sphere, and I only have 3 points, so I don't think this will work for me.

Thanks again to everyone. Big help overall. Any other comments still welcome.
 
I don't know if anyone has mentioned this but if this is a distorted pipe aren't you going to need some statistical component to the analysis as the points may be on a distorted part of the pipe or have the measurements been very careful to avoid a distorted part of the pipe.
 
OK, now I understand
But, you must know that in order to get a circle that is tangent to lines formed by pts 1 and 2 at pt 1 and pts 2 and 3 at pt 3, the lines 1-2 and 2-3 must be of equal length.
First write the equation of the plane (pts1,2,3)
eq1 x+ay+ bz=c
where a,b and c are determined by entering the coordinates of the 3 points, giving 3 equations whose solution of a,b,c determines the plane of eq1.

Now we get the direction cosines of the 2 lines 1-2 and 2-3
which are proportional to

line 1-2
(x1-x2),(y1-y2),z1-z2)

line 2-3
(x2-x3),y2-y3),z2-z3)

Next, we draw lines from a point X,Y,Z on the plane of eq1 to pt 1 and pt 3. Their respective direction cosines are proportional to:
(X-x1),(Y-y1), Z-z1) line Q X,Y,Z to x1,y1,z1
(X-x3),Y-y3),Z-z3) line R X,Y,Z to x3,y3,z3
Since line Q is perpendicular the line 1-2 at point 1 and line R is perpendicular to line 2-3 at point 3,(definition of tangency), the dot product of these respective line pairs are zero
Expanding
(X-x1)*(x1-x2)+(Y-y1)*(y1-y2)+(Z-z1)*(z1-z2)=0
(X-x3)*(x2-x3)+(Y-y3)*(y2-y3)+(Z-Z3)*(z2-z3)=0
From eq 1, X,Y, Z being in the plane, is constrained by
X+aY+bZ=c
Now we have 3 eq and 3 unknowns in X Y and Z
The solution X,Y,Z is the center of the circle.
A note of caution. I REPEAT, that you MUST have the 2 lines 1-2 and 2-3 of equal length; otherwise you wlll get wrong answers.
Hope this helps
 
i'd simply zeke's approach by redefining the three (xyz) points in terms of their common plane, (XY), removing one dimension.

now you know two tangents, (X1Y1-X2Y2) and (X1Y1-X3Y3), and two points of tangency, (X2Y2) and (X3Y3). determine the normals to the tangents thru the points of tangency. their intersection is the centre of the arc.
 
Status
Not open for further replies.
Back
Top