infinisa

Hello AaronHarrison

You almost got it right, but the formula is not general enough (just as y=mx + c doesn't cover the case x=0).

The general formula for a line in 3 dimensions is:

(x - a)/p = (y - b)/q = (z - c)/r

[= real parameter t - see below]

In this formula, (a, b, c) are the coordinates of a point the line passes through;

(p, q, r) are the coordinates of a direction vector along the line.

In fact it is easy to see that this is equivalent to the vector equation r = a + td,

where

r is the vector (x, y, z),

a is the vector (a, b, c),

t is a real parameter (can take any real value),

d is the vector (p, q, r).

The vector equation is valid in any number of dimensions, and its cartesian version can easily be generalised to any number of dimensions - including 2.

BTW, I can't understand why Bikerman locked your topic, as your question is about 3D, and his link was to the 2D case.

Hope this helps!

Quote: |

How, mathematically, can you describe a line in 3-space.
z = mx + c = ny + d ?? Does this work? I need to know for some 3d programming: once I have the equation intersections will be easy... |

You almost got it right, but the formula is not general enough (just as y=mx + c doesn't cover the case x=0).

The general formula for a line in 3 dimensions is:

(x - a)/p = (y - b)/q = (z - c)/r

[= real parameter t - see below]

In this formula, (a, b, c) are the coordinates of a point the line passes through;

(p, q, r) are the coordinates of a direction vector along the line.

In fact it is easy to see that this is equivalent to the vector equation r = a + td,

where

r is the vector (x, y, z),

a is the vector (a, b, c),

t is a real parameter (can take any real value),

d is the vector (p, q, r).

The vector equation is valid in any number of dimensions, and its cartesian version can easily be generalised to any number of dimensions - including 2.

BTW, I can't understand why Bikerman locked your topic, as your question is about 3D, and his link was to the 2D case.

Hope this helps!