# Line plot 3d

Hey.

Is it possible to plot a line in 3D from one point to another?
The source of the points is a list.

Dale
Mentor
2021 Award
Yes.

Hepth
Gold Member
List1 = {{1, 1, 1}, {3, 4, 5}};
List2 = {{-3, 1, 2}, {2, 1, 5}};
L3 = {Line[List1], Line[List2]}
Graphics3D[L3, Axes -> True,
PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}]

Thank you.

I have a long list with points from an external file. How can i do this?
{{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1},...}

Every 2nd point should be the end-point of the line.
Or is it better to make it like this?
{{3,6,5,2,4,1},{3,5,4,6,7,4},{3,2,1,1,1,1},...}

Last edited:
Dale
Mentor
2021 Award
I have a long list with points from an external file. How can i do this?
{{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1},...}
If your long list of points is in a variable called dat (i.e. dat={{3,6,5},{2,4,1},{3,5,4},{6,7,4},{3,2,1},{1,1,1}}) then

Graphics3D[Line[Partition[dat,2]]]

will plot the lines

great support in this forums.

Thanks a lot DaleSpam.

greets
button