Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you expand on this? I\'m not sure how to start. I\'m great at programing, bu

ID: 3661524 • Letter: C

Question

Can you expand on this? I'm not sure how to start. I'm great at programing, but i'm not sure of the math behind this: (in calc 3 class)

Design and implement computer codes that takes inputs

i) Any ellipsoid specification, i.e. a, b, and c. (let’s keep the center at the origin, and the ellipsoid is aligned along x- y- z- axes. See figure)

ii) Any point in xyz-space, (x0, y0, z0)

, and produces the output,

Location of the points on the ellipsoid whose distance to (x0, y0, z0) is smaller than or equal to any other point’s distance to (x0, y0, z0

Explanation / Answer



And you can see it on a map (aren’t those Google guys wonderful!)

Distance

This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).

Note in these scripts, I generally use lat/lon for latitude/longitude in degrees, and / for latitude/longitude in radians – having found that mixing degrees & radians is often the easiest route to head-scratching bugs...

Historical aside: The height of tech­nology for navigator’s calculations used to be log tables. As there is no (real) log of a negative number, the ‘versine’ enabled them to keep trig func­tions in positive numbers. Also, the sin²(/2) form of the haversine avoided addition (which en­tailed an anti-log lookup, the addi­tion, and a log lookup). Printed tables for the haver­sine/in­verse-haver­sine (and its log­arithm, to aid multip­lica­tions) saved navi­gators from squaring sines, com­puting square roots, etc – arduous and error-prone activ­ities.

The haversine formula1 ‘remains particularly well-conditioned for numerical computa­tion even at small distances’ – unlike calculations based on the spherical law of cosines. The ‘versed sine’ is 1cos, and the ‘half-versed-sine’ is (1cos)/2 = sin²(/2) as used above. Once widely used by navigators, it was described by Roger Sinnott in Sky & Telescopemagazine in 1984 (“Virtues of the Haversine”): Sinnott explained that the angular separation between Mizar and Alcor in Ursa Major – 0°1149.69 – could be accurately calculated on a TRS-80 using the haversine.

For the curious, c is the angular distance in radians, and a is the square of half the chord length between the points. A (remarkably marginal) performance improvement may be obtained by factoring out the terms which get squared. If atan2 is not available, c could be calculated from 2 asin( min(1, a) ) (including protection against rounding errors).

(all angles
in radian

(all angles
in radians)

Just as the initial bearing may vary from the final bearing, the midpoint may not be located half-way between latitudes/longitudes; the midpoint between 35°N,45°E and 35°N,135°E is around 45°N,90°E.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote