4 ms·
I can only imagine what a ridiculous problem it would be to try to re-do, for example, the Vincenty formula for distance between two latitude/longitude points o
by walrus01 2mo ago
I can only imagine what a ridiculous problem it would be to try to re-do, for example, the Vincenty formula for distance between two latitude/longitude points on an oblate spheroid (the earth) if it couldn't use radians.
https://en.wikipedia.org/wiki/Vincenty%27s_formulae https://en.wikipedia.org/wiki/Vincenty%27s_formulae
https://www.johndcook.com/blog/2018/11/24/spheroid-distance/ https://www.johndcook.com/blog/2018/11/24/spheroid-distance/
Further, inverse vincenty is pretty much an essential in anything that needs to find the azimuth between two points on a map. Such as for microwave radio link planning purposes.
Karney (2013) is also radian dependent.
https://github.com/pbrod/karney https://github.com/pbrod/karney
- ErroneousBosh 2mo agoI absolutely love how full Wikipedia is of completely useless pages like the Vincenty's Formulae one, where someone has just gone "look this is what it says in my maths textbook" without any explanation. No discussion of why you'd use this over for example the Haversine function, of course, just a straight out copypasta and a demonstration of how clever someone is at the mathematical notation markup. Incidentally you'd use this instead of Haversine if you wanted to be really really accurate down to millimetres across a long baseline, as opposed to lots and lots of "it's ten miles that way in a straight line" very quickly and simply.
- walrus01 2mo agoIt would sure be better if it had some concrete explanations and examples why vincenty is preferred. It's also barely any more computational load on modern computers so very little reason not to use it. Haversine is strongly deprecated in even short distance applications like planning a 35 km point to point licensed band radio microwave link, because you risk having both slightly the wrong distance and the azimuth figure being off by a tenth of a degree. Vincenty in python form is quite compact. Karney by comparison is something like 1000 lines of code. And the difference is going between like a few mm precision to nanometers.
- ErroneousBosh 2mo agoI've actually implemented Haversine in a SQL query to find what can be summed up as "which of these moving things is closest to this thing right now". It's not the tidiest, and I had to ask someone better at SQL than I am to make it entirely work, but it looks like it is easier than doing Vincenty. I should try it, right? Edit: I also wonder what's to be gained by being accurate to nanometres over the surface of a fairly inaccurate planet. My application was to locate movable things to identify which was nearest to a moorland wildfire, where you need to be accurate to within about 1km at best - you don't need to drop the pin right on it, you'll know where you're going when you see it ;-)
- srean 2mo agoFor that application you needn't have bothered. On a sphere arc-length and Euclidean distance are monotonically related, so the minimizer would not have changed.
- blululu 2mo agoWriting full articles takes time and effort. But the effort is cumulative, so these stub articles are really just the start. Some of the comment you made here would definitely improve the article. You are always welcome to edit and improve Wikipedia. I mean this literally and sincerely, it is one of the few places on the internet where you might benefit from posting.
- eldaisfish 2mo agoit is quite telling that wikipedia has pages upon pages documenting pokemon, but relatively limited context about maths or science, beyond what's in textbooks.
- Apocryphon 2mo agoTelling what? STEM academics are busier than Pokémon fans to contribute to Wikipedia? Or they care less about the cause of Wikipedia? That as a society we produce more of the latter than the former? There’s no definitive rationale to be told simply by that observation.
- ErroneousBosh 2mo agoIt's not a "stub article" though, it's just a paragraph and then a bunch of stuff plagiarised from a maths textbook. I already edit quite a bit on Wikipedia. I stay away from the maths bits, because it's a little outside my area of expertise - and because it's just things like "it's a function to calculate distance, and here's ten pages of algebra with no explanation" I can't really improve that on Wikipedia.
- jacobolus 2mo agoYou might enjoy the much longer and more detailed article https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid which discusses the context.
- ErroneousBosh 2mo agoI've read that, quite some time ago, which is how I understand how the Haversine function works. Kind of. A bit. Enough to make it work, anyway.
- lowbloodsugar 2mo agoLatitude and Longitude? By definition it’s not starting in radians. After that, pi is involved but that doesn’t mean you have to use radians, unless you define “anything that uses pi is radians”. The discussion TFA started was about programming computers optimally. If you want the code to be readable by humans with a math background, or Wikipedia background, sure, use the algorithms as written down. TFA was not targeting that audience. It was targeting folks who care about two pointless multiplies in their (checks notes) game engine.
- adrian_b 2mo agoThe radians provide absolute no help for your problem. There are alternative trigonometric functions with the argument measured in cycles that can be used instead of those with argument measured in radians. All formulae written with sin, cos and atan can be rewritten with sin2pi, cos2pi and atan2pi, or whatever names you want for those functions. Moreover, before the electronic computers, nobody in the entire history of mankind had used trigonometric functions with arguments measured in radians for any practical problem, like astronomical or geodesy problems. The radians became popular in the 19th century, only for symbolic computations, because they simplify the formulae for derivatives and primitives. For all numeric computations, even in the 19th century, nobody used trigonometric functions with arguments measured in radians, but only trigonometric functions with arguments measured in sexagesimal degrees, which behave much more similarly to the functions with arguments measured in cycles, than to the functions with arguments measured in radians, which cannot be computed exactly for any rational argument, and where the argument can never be reduced exactly to a value in the first quadrant. While the trigonometric functions with arguments in radians are harmful, the constant 2Pi remains an essential constant, which must be used to convert between the length and the central angle that correspond to a circular arc, and also to compute the derivatives and primitives of the exponential 1^x and of the trigonometric functions.
- srean 2mo agoSome anecdotes to support and color your point. The sin function has Indian and Greek roots. Part of that history is in the name 'sin' itself. I will let you all look that up. It's quite a funny story especially the jya to jayb bit. This comment is about computation of sin in Indian mathematics and its definition. The analogue of the sin function in Indian mathematics was a function from length to length. It was defined as the length of the half chord that corresponds to the angle, not of a unit radius circle but of a circle of radius 3438 units. But why 3438 ? That requires understanding the Indian system of measuring angles by length. They wanted to have a numeric precision of 1 arc minute but weren't very fond of manipulating fractions. So they incorporated their requirement in how they standardized their circle -- Not by radius or diameter but by arc length. They chose that circle to be the standard for which the arc length of one arc minute is unit length. If one does the math, it is 360 * 60 / 2π. Plugin the accuracy of π that was known to Indian mathematicians of that time you get a radius of 3438 units. If you are curious about their numeric calculation of sin look up Aryabhatta and Bhaskara. Wikipedia is quite informative. https://en.wikipedia.org/wiki/%C4%80ryabha%E1%B9%ADa's_sine_table https://en.wikipedia.org/wiki/%C4%80ryabha%E1%B9%ADa's_sine_... https://en.wikipedia.org/wiki/Bh%C4%81skara_I%27s_sine_approximation_formula https://en.wikipedia.org/wiki/Bh%C4%81skara_I%27s_sine_appro...