Hi,
>> This is part of another goal and that is to plot random x, y, z data points about this line.
>> If anyone has ideas about this as well that would be great, but the line is my main interest right now.
Given a line specified by end points (
{{1, 1, -1}, {2, 2, 1}} in your case),
it is possible to define a frame using translations and rotations where line will coincide with one of the axis.
In this new frame line end points are
{{0,0,0},{0,0,length}}Placing random points in the new frame is easy . I used a cylinder area to place points in:
endpoints = {{0, 0, 0}, {0, 0, 1}};
rad = 0.2;
points = DeleteCases[
Table[{RandomReal[{-rad, rad}], RandomReal[{-rad, rad}],
RandomReal[{0, 1}]}, {i, 1,1000}], _?(#1[[1]]^2 + #1[[2]]^2 > rad^2 &)];
Show[
Graphics3D[{Thick, Line[endpoints]}],
Graphics3D[{PointSize[Large], Yellow, Point[points]}],
Graphics3D[{Opacity[0.1], Cylinder[endpoints, rad]}]
]
You might consider using
Rotate[] and
Translate[] functions for
Graphics3D[] to transform your line into new frame,
then generate points with above method, and finally inverse-transform everything (line and generated points) back to the old frame.
Probably there is a better way, but you can give this a try.
I.M.