You are invited to Log in or Register a free Frihost Account!

Maths -- 3d lines

xavax
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...
Bikerman
You need 2 equations (assume the line goes through the origin)...
y=mx and z/(y^2 + x^2)^1/2 =+/-C

Obviously it follows that the distance between any two points in 3D space is given by
(x^2 + y^2 + z^2)^1/2
Indi
i don't think parametric equations are particularly useful in 3D graphics, but if it works, go with it.

For a non-parametric equation of a line, it's just mV + R, same as in 2D or any other "D". If two lines intersect, then m₁V₁ + R₁ = m₂V₂ + R₂. That's three equations, two unknowns. If you get a consistent solution, you have your intersection point. If you don't, no intersection.
xavax
Thanks guys
finekiss
.
Well in general the equations are:
Cartesian (x-x0)/(x1-x0) = (y-y0)/(y1-y0) = (z-z0)/(z1-z0) = k;
Where (x0,y0,z0), (x1,y1,z1) are two points in space

and in parametric:
x = x0 + kt0
y = y0 + kt1
z = z0 + kt2
metalfreek
To represent a line in 3D
consider two planes a1x+b1y+c1z+d1=0
and a2x+b2y+c2z+d2=0
then the intersection these two planes represents a line and its equation is

a1x+b1y+c1z+d1=0=a2x+b2y+c2z+d2

so, st. line is represented by two equations of first degree in x,y,z.

I hope you understand the notation.
nisibdv
Why don't you do a parametric representation of the curve?:

l=(lx(t),ly(t),lz(t)).

li(t)=ai+bi*t

with i=x,y or z and ai, bi, fixed constants.

I think that is the fastest and clearer way to do that.
Related topics