[fortran90] cartesian to polar coordinate

Click For Summary
SUMMARY

The discussion focuses on writing a FORTRAN90 subroutine to convert Cartesian coordinates (x, y, z) into spherical polar coordinates (r, q, f). The program must read coordinates from a text file, handle multiple points, and output angles q and f in degrees, adhering to specified ranges. The subroutine and main program should be maintained as separate files, ensuring modularity and reusability. The conversation emphasizes the importance of self-coding, as external assistance is not provided in this forum.

PREREQUISITES
  • FORTRAN90 programming language
  • Understanding of Cartesian and spherical coordinate systems
  • File I/O operations in FORTRAN90
  • Basic knowledge of modular programming concepts
NEXT STEPS
  • Implement a FORTRAN90 subroutine for coordinate conversion
  • Explore FORTRAN90 file handling techniques for reading and writing data
  • Learn about angle conversions between radians and degrees
  • Investigate dynamic memory allocation in FORTRAN90 for handling arrays
USEFUL FOR

This discussion is beneficial for FORTRAN90 programmers, students learning computational geometry, and developers working on scientific computing applications requiring coordinate transformations.

2000yak
Messages
1
Reaction score
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
 
Physics news on Phys.org
Yak, you have been tragically mis-informed. PF is not a job-shop code shack. You've got to do all your own coding.
 
Thread closed.

2000yak, read your private messages.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 47 ·
2
Replies
47
Views
7K