0
|
13063 Views
|
5 Replies
|
0 Total Likes
View groups...
Share

# How do I combine 3 lists into one 3d list?

Posted 9 years ago
 I am wondering how to combine lists as in the following description. Here is my code. (* Create empty lists *) xlist={}; ylist={}; zlist={}; (* Take inputs for ECEF *) (Label[startinput];x = Input["What is the x coordinate?"]; y = Input["What is the y coordinate?"]; z = Input["What is the z coordinate?"]; AppendTo [xlist, x] AppendTo [ylist, y] AppendTo [zlist, z] (Label[errorcontrol]; again=InputString["Enter more coords? Y for yes, N for no"]; If [again=="Y", Print["Okay!"];Goto[startinput]]; If [again!="N", Print["Sorry, this is an invalid input here!"];Goto[errorcontrol]]; If [again=="N", Print["Okay."]])); (* Debugging *) Print[xlist] Print[ylist] Print[zlist] Print[x] Print[y] Print[z] (* Put in Coordinate Form *) GeoPositionXYZ[{x, y, z}, "ITRF00"]; (* Convert to LLA *) GeoPosition[%] (* Display Map *) GeoGraphics[GeoMarker[GeoPosition[%]],GeoRange -> "World", GeoProjection -> "Robinson"] (* Display 3D Plot *) ListPointPlot3D[{{x, y, z}}] I need to know how to combine listx (the list of x coords) and listy (the list of y coords) and listz (the list of z coords) into one list of 3D coords in form {{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3} etc...} Thank you.
5 Replies
Sort By:
Posted 9 years ago
 Length[myList] 
Posted 9 years ago
 Thanks. Now that I have a list of 3 dimensional points, how do I find out how many points are in the list? I need to write a for loop that goes through them all, converts them all to latitude/longitude, and puts them all on the same 2d map.
Posted 9 years ago
 Sorry, Transpose[{xlist,ylist,zlist}] 
Posted 9 years ago
 Transpose[xlist,ylist,zlist] 
Posted 9 years ago
 list=Transpose[xlist,ylist,zlist] returns this error: Transpose::nonopt: Options expected (instead of {333333,77777}) beyond position 2 in Transpose[{111111,55555},{222222,66666},{333333,77777}]. An option must be a rule or a list of rules. >>
Community posts can be styled and formatted using the Markdown syntax.