Plotting a Line in 3D from a List of Points

  • #1
10
0
Hey.

Is it possible to plot a line in 3D from one point to another?
The source of the points is a list.
 
  • #3
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}}]
 
  • #4
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:
  • #5
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
 
  • #6
great support in this forums.

Thanks a lot DaleSpam.


greets
button
 

Suggested for: Plotting a Line in 3D from a List of Points

Replies
2
Views
1K
Replies
5
Views
718
Replies
1
Views
799
Replies
6
Views
941
Replies
2
Views
662
Replies
4
Views
718
Replies
0
Views
562
Replies
2
Views
643
Back
Top