# Thread: Find the ceneter of the curve in 3D made by 4-points

1. ## Find the ceneter of the curve in 3D made by 4-points

A(Ax,Ay,Az)
B(Bx,By,Bz)
C(Cx,Cy,Cz)
D(Dx,Dy,Dz)

EXAPMLE:
Points X Y Z
a -2.00 0.00 -1.00
b -2.00 0.00 -1.59
c -1.59 0.00 -2.00
d -1.00 0.00 -2.00
The Answer is supposed to be ? Center: X:-1.0 Y:0.0 Z:-1.0

What I am trying to solve is to find the equation of the plane based on two vectors AB , AC; then find the normal vector, and then find the plane equation, which look like this:

mX+nY+oZ = m(Ax) + n(Ay) + o(Az) where
m = (By-Ay)(Cz-Az) - (Bz-Az)(Cy-Ay)
n = (Cx-Ax)(Bz-Az) - (Bx-Ax)(Cz-Az)
o = (Bx-Ax)(Cy-Ay) - (By-Ay)(Cx-Ax)

Now that I have the equation of the plane I am trying to find the the center of curve by using the equation of the plane.
I believe i need to find a perpendicular vector to AB vector in my plane, and another perpendicular vector to CD vector in my plane, and find where the two vector meets, and that point would be the center of curve drawn. But I don't know how to do that??

2. I don't quite understand what the "center" is supposed to be; in your example, the four points lie in the same plane, and the two vectors are orthogonal, but is it always the case? Then the "center" would be the intersection of (the line going through A and parallel to (CD)) and (the line going through D and parallel to (AB)), is this correct? If so, use the equations of these lines, rather than the equation of a plane: the center can be written $\displaystyle A+\lambda \overrightarrow{CD}=D+\mu \overrightarrow{AB}$ for some $\displaystyle \lambda,\mu\in\mathbb{R}$, this gives you two linear equations (even three) for $\displaystyle \mu$ and $\displaystyle \lambda$, solve them and you are done.

3. ## Find the center of the curve in 3D made by 4-points

I don't really agree with the images describing the situation "very well"... A few words are sometimes better than a thousand sketches. If the interpretation I give in my previous post is still correct (honestly, I doubt about it), then you have the equation: $\displaystyle \mu\overrightarrow{AB}+\lambda\overrightarrow{DC}= \overrightarrow{DA}$. Compute the components of these three vectors, let us call them $\displaystyle (x,y,z)$ for $\displaystyle \overrightarrow{AB}$, $\displaystyle (u,v,w)$ for $\displaystyle \overrightarrow{DC}$ and $\displaystyle (a,b,c)$ for $\displaystyle \overrightarrow{DA}$. Then you have three equations by looking at the three coordinate in the previous vector equation: $\displaystyle \mu x +\lambda u=a$, and so on. Take the first two, this gives you $\displaystyle \mu=\frac{av-ub}{xv-uy}$ and $\displaystyle \lambda=\frac{xb-ay}{xv-uy}$. However, it may happen that the denominator is zero. In this case, you must use the last two equations instead. Replace $\displaystyle u$ by $\displaystyle w$, $\displaystyle x$ by $\displaystyle z$, $\displaystyle a$ by $\displaystyle c$. If the denominator again is zero, this means that the four points are on two parallel lines and there is no solution. Actually, you don't need both $\displaystyle \mu$ and $\displaystyle \lambda$ since $\displaystyle Z=A+\lambda\overrightarrow{CD}$.