Each sphere has a position determined by theta (x,y plane angle) and tau (elevation angle) as well as L, the distance of the center of the sphere from the origin. Each sphere also has a radius, r, and a density of rho.
These values are defined in a single input matrix: sceneAttributes
The output should be a 1x3 matrix defining the CoM in cartesian 3D space (x, y, z)
All angles are in degrees, all distances are in meters, and density is in kg/m^3
Assume density and lengths are always positive
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
-
Find the "ordinary" or Euclidean distance between A and Z
176 Solvers
-
270 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13593 Solvers
-
07 - Common functions and indexing 3
425 Solvers
-
788 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
My calculation does not agree with test #4. Also, it is odd (but unimportant) that the values for theta go from -360 to +360 rather than -180 to +180
Your result for test #4 is clearly wrong. Simply add up the masses with positive elevation and the masses with negative elevation, and you'll see that the CoM must be below the xy plane.
**Found error in solution and corrected; rescored submitted solutions. Cheers!