Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the commonly used calculation formulas on the earth in big data's development?

Shulou Source: shulou.com Published: 2022-06-01 03:31:49 11月13日 Update

Editor to share with you what are the commonly used calculation formulas on the earth in the development of big data. I hope you will gain something after reading this article. Let's discuss it together.

The website is http://www.movable-type.co.uk/scripts/latlong.html

Some common calculations are done according to longitude and latitude, and there is sample code for JavaScript.

Please watch the introduction website in English patiently.

Haversine formula to calculate the distance according to the longitude and latitude of two points

Spherical Law of Cosines cosine sphere law

Calculate the location of the center point of two points

Given a point and distance, threshold, calculate the location of another point on the earth

Whether the two lines on the earth intersect

...

All have detailed formulas and sample code, such as:

Haversine

Formula:a = sin ²(Δ φ / 2) + cos φ 1 ⋅ cos φ 2 ⋅ sin ²(Δ λ / 2) c = 2 ⋅ atan2 (√ a, √ (1 − a)) d = R ⋅ cwhere φ is latitude, λ is longitude, R is earth's radius (mean radius = 6371km)

Note that angles need to be in radians to pass to trig functionsqualified JavaScript Var R = 6371e3; / / metresvar φ 1 = lat1.toRadians (); var φ 2 = lat2.toRadians (); var Δ φ = (lat2-lat1). ToRadians (); var delta λ = (lon2-lon1). ToRadians () Var a = Math.sin (delta φ / 2) * Math.sin (delta φ / 2) + Math.cos (φ 1) * Math.cos (φ 2) * Math.sin (Δ λ / 2) * Math.sin (Δ λ / 2); var c = 2 * Math.atan2 (Math.sqrt (a), Math.sqrt (1mera)); var d = R * c After reading this article, I believe you have a certain understanding of "what are the commonly used calculation formulas on earth in big data's development". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!

Tags: Formula earth common use data development two code example article latitude and longitude latitude and longitude web site patience center point location cosine finished law and more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno vpn Shulou Technology MariaDB