Switching a Boundary Condition to Spherical Coordinates

1 view (last 30 days)
Hollis Williams
Hollis Williams on 22 Mar 2019
I am working with a problem on a sphere where I have a formula which gives me the coordinates of a number of nodes distributed at equal distances from each other around a sphere in spherical polar coordinates, so if there are 100 nodes, I can use the formula to get a vector which is 3 x 100, each column corresponding to one of the nodes and then 3 entries for theta, phi, r.
For a boundary condition, I then need to create a 300 x 1 column vector, where you build the column by going to node 1, take cos of its theta component in first row, sin theta in second row, then 0 in the third row. You then go to next node and repeat this and move down the column until it is 300 x 1. What would be the easiest way of doing this?
Let me know if further explanation required.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!