- #1
2000yak
- 1
- 0
Write a short FORTRAN90 subroutine to convert Cartesian coordinates (x, y, z) to spherical polar coordinates (r, q, f) using
• Write a FORTRAN90 program which uses this subroutine to convert the following (x, y, z) coordinates which are read from a text file and stored within a single vector (1D allocatable array) – (3.0, 4.5, -1.0) , (5.2, 2.6, 1.4) , (-1.0, -1.0, 0.0) , (0.0, 3.0, 3.0)
• Note that: – Both q and f should be output in degrees with 0 £ q £ 180º and 0 £ f < 360º – Both the program and the subroutine should be edited as separate files – The program should be able to convert any number of points and the results should be written to a text file.
this is the problem...
please... code this in fortran
• Write a FORTRAN90 program which uses this subroutine to convert the following (x, y, z) coordinates which are read from a text file and stored within a single vector (1D allocatable array) – (3.0, 4.5, -1.0) , (5.2, 2.6, 1.4) , (-1.0, -1.0, 0.0) , (0.0, 3.0, 3.0)
• Note that: – Both q and f should be output in degrees with 0 £ q £ 180º and 0 £ f < 360º – Both the program and the subroutine should be edited as separate files – The program should be able to convert any number of points and the results should be written to a text file.
this is the problem...
please... code this in fortran