R Programming

Job ID: 33966707

Budget: $10 – $30 USD

I will provide a text file of a series of coordinates in (x,y,z) format. This is like the Cartesian plane (x,y), but with a third dimension. Your task is to create a set of code that will do the following things:

1. Read in the contents of the text file to a table, with headers as given in the file.
2. Make the following things the body of a loop:
a. One that will convert an (x,y,z) into cylindrical coordinates (r,θ,z)
b. One that will convert an (x,y,z) into spherical coordinates (p,θ,φ)
3. Using some kind of loop, use this procedure to populate either a matrix or array that contains the
converted values (cylindricals separate from sphericals)
4. After the loop has completed, write each of those arrays/matrices to a separate .csv file.
Related categories: R Programming Language Data Analysis