Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Plotting arcs in 3D space

Plotting arcs in 3D space

Plotting arcs in 3D space

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?

RE: Plotting arcs in 3D space

Have you Googled "spline", or "NURBS" (Nonuniform rational B-spline)?

Good Luck,


RE: Plotting arcs in 3D space

mmm splines - haven't heard that term for almost 25 years.  I'll give that a try.

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

NURBS - that stuff is brilliant.  Doesn't really give me what I want but I can see a use for it.

RE: Plotting arcs in 3D space

I'm not a mathematician, but here goes:

(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

Basically I was planning on doing that but just wondered;  instead of using transformations, to move from a 3D space to a 2D space, do regression analysis, work out points then transform them back into 3D space, would it be possible to find the formula of a curved line 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

Another thought then:

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

lonehill - I never thought of that - that's a brilliant idea.  And it is so simple.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close