I would like to iterate over a nested list of the following format:
q={{1,{r1,t1,p1},{}},{2,{r2,t2,p2},{}}}
where r,t and p are numbers (spherical coordinates).
In the empty sublists I would like to enter the cartesian coordinates {x,y,z}, so that the list looks like:
q={{1,{r1,t1,p1},{x1,y1,z1}},{2,{r2,t2,p2},{x2,y,z2}}}
I have done this with a Do-loop and it works, but since I'm experimenting with functional programming, I was wondering if this would be achievable by using Map (or a similar function).
Of course mapping the FromSphericalCoordinates-Function to the spherical coordinates (in sub-list #2) works, but how could I update the empty sub-list #3 for the cartesian coordinates?
Any idea whether and how this works?