By DePaul Dimadis
Choose your prefered Language: greek_flag uk_flag

The Spherical Coordinate System determines the position of a point of the three-dimensional planar space by means of two angles and a distance from the beginning O. Transformation from the Spherical Coordinates () r ,, θφ into the Cartesian Coordinates () x, y, z is realized through of the types:
Specify a structure named m_coords to manage material points of mass im of a solid body. The members of the structure are the mass and the three spherical coordinates () r, θf, as defined above. All values ​​are double.
The program should include functions for:
i. the input of n (n = known) material data into a table of m_coords structures (data_entry function). Use random double numbers with 50.0 for the mass, 10.0 for the distance and 3.0 for the corners.
ii. (1 row for each material point) (data_display function).
iii. finding the cartesian coordinates of the mass center of the solid body from all the material points of the table of structures according to the following formulas (a function named find_mass_center):
The three functions will be called consecutively from main (). After calling the find_mass_center function, the program should display the values ​​for KMx, KMy, KMz.