Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report