## Plotting arcs in 3D space

## Plotting arcs in 3D space

(OP)

I've got 3 points in 3D space that I want to fit a curve to. I can figure out the math in 2D space but not in 3D space. I've searched for 3D, points, plotting but haven't been very successful. I'm basically looking for the math around the problem so I can work out the points along the path. I'm not interested in plotting it: just in working out the points.

What keywords should I be googling for?

What keywords should I be googling for?

## RE: Plotting arcs in 3D space

Good Luck,

Greg

## RE: Plotting arcs in 3D space

I also tried linear regression - gave me a load of stuff on straight lines: nothing n a quadratic on a slanting plane which is what I really want.

## RE: Plotting arcs in 3D space

## RE: Plotting arcs in 3D space

(1) If you're working in 3 dimensions, you have to distinguish between a line of best fit, and a plane of best fit. You're clearly looking for a line, but many methods will be aiming to fit a plane.

(2) Since you have only 3 points, they must lie in a flat plane. Probably step 1 is to find that plane.

(3) Having found the plane, you can map your points on the plane, and draw the line through them using the normal 2d methods. Then you simply step along the line and add the appropriate coordinates for the plane to get the coordinates in "real" space.

Good luck!

## RE: Plotting arcs in 3D space

It is just something I never covered in A level further maths. Did a lot on planes and transformational geometry but not the formula for a quadratic or an ellipse in 3D space.

I'm keeping that as a pet project to do on a rainy day or after the project panic has died down. In the mean time it is just transformational geometry and curve fits.

## RE: Plotting arcs in 3D space

Because you're looking for a line, you are not trying to fit one equation of the sort

z = f(x, y)

Instead you're trying to fit two equations

z=f(x), y=f(x) in order to return a line of points (z,y) from x

This being the case, you could simply do two two-dimensional fittings. Forget y altogether, and fit a curve for z. Do the same for x. Then calculate your points z,y,x from x using both equations.

## RE: Plotting arcs in 3D space

http://mathworld.wolfram.com/CubicSpline.html

http://mathworld.wolfram.com/BezierCurve.html

## RE: Plotting arcs in 3D space