I took complements of the test case polar angles in order to agree with customary definitions of polar angle.
I agree. Polar angles are, by convention, measured from the pole, but in this problem you have to consider them to be measure from the equator if you wish to agree with the test cases.
I think considering polar angles measured from pole or from equator does not affect the result in this problem. But if you consider polar angle of the first point measured from pole and the polar angle of the second one from equator it will produce misleading solutions. So, you need to stabilish the same convention for both points.
How to find the position of an element in a vector without using the find function
surface of a spherical planet
pressure to dB?
Create a vector
Write c^3 as sum of two squares a^2+b^2
Set a Soroban Abacus
Clock Hand Angle 1
First N Perfect Squares
Roll the Dice!
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office