Equation of a line.

On a previous thread, David posted that A+t*(B-A) was the expression for any linear curve in any number of dimensions. I was not sure, but I figured that A and B must be vectors, and t was a parameter, and made the below definition to try it out. (lots of components to draw a line, but I'm just trying to understand the equation)

I had been searching for advice on some geometry topics worth exploring for a class, and now I'm in the class and the teacher wants me to start by learning about splines in general (not nurbs). I just spent the day learning linear spline interpolation, then quadratic, then cubic. I didn't try working them by hand yet, but I'm getting the concepts. It seems cubic is the lowest degree where you can get C2 continuity, which makes it smooth. I read over parameterization and how that simplifies the number of equations. I read about space curves, and then the differences between Hermite, Catmull-Rom, and Cardinal spline, but then got tired and had a cocktail.

So I guess I'm looking for any direction or advice on how to understand parametric curves in 3d space, and how they can be defined (splines or otherwise). Thanks!!!


  • up

    David Rutten

    Hi Chris,

    nice job, A and B are actually points, not vectors. They are the start and end points of the finite segment.

    If you sample the line segment purely on the 0.0 to 1.0 parameter range, you'll 'discover' the {1,1,2} and {2,-1,-1} points as the extremes.

    You can of course rewrite the line equation using a point and a vector, for example:

    A + t * S

    where A is the start point of the line, t is the parameter along the line and S is the direction vector of the line. The direction of course is the vector from A to B, which is why you can replace (B-A) with S without changing the line in the slightest.

    A+t*(B-A) is usually used to define finite and infinite line segments, whereas A+t*S is more often used to define rays (semi-infinite line segments).


    My cubic spline math is not really up to snuff, but it is reasonably easy to create a deCasteljau evaluator for a 4-point, cubic, bezier curve (no weights allowed). deCastelau allows you to evaluate the location and the tangent of a cubic spline in a very visual way. There are other algorithms to evaluate these properties (better algorithms), but they don't allow you to visually construct the answers.

    --
    David Rutten
    david@mcneel.com
    Poprad, Slovakia
    8