To get a straight line vector from point A to point B:
B - A
which translates to:
vector.x = bx - ax; vector.y = by - ay; vector.z = bz - az;
Length:
length = Math.Sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z);
To get a point at some distance along the vector, you need to make the vector a unit vector (length 1):
vector.x = vector.x / length; ...
and then multiply them by the distance:
vector.x = distance * vector.x; ...
This is all from memory, so you cannot immediately compile.
Here is the Vector type for C # in CodeProject that will do this for you.
If you need a curve, you will need:
a) to determine what type of curve you want (arc, spline, etc.)
b) more points (centers, control points, etc.)
Chrisf
source share