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

How to realize the conversion of longitude and latitude and three-dimensional three-dimensional coordinates in big data's development

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article is about how to realize the conversion of longitude and latitude and three-dimensional three-dimensional coordinates in the development of big data. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

In the spherical coordinate system, the coordinates are marked by longitude and latitude, and the latitude, like the longitude, is an auxiliary line assumed for the convenience of measurement, which is defined as the trajectory formed by the rotation of the earth at a certain point on the earth's surface.

Any line of latitude is round and parallel. The length of the line of latitude is the circumference of the equator multiplied by the cosine of the latitude of the line of latitude, so the equator is the longest, and the farther away from the equator, the shorter the perimeter, and then shrinks to zero at the poles. From the equator to the north and south, each 90 °, called north latitude and south latitude, represented by "N" and "S" respectively.

In the actual calculation, latitude and longitude generally can not be calculated directly, and it needs to be converted, such as calculating distance, etc., assuming that the earth is a positive circle, placed in a large three-dimensional coordinate system, the original center is the spherical center of the earth, and the coordinates are converted into three-dimensional numbers, which is convenient for calculation.

The following share of the C # version, latitude and longitude and three-dimensional three-dimensional coordinate conversion, is a mathematical conversion, without detailed explanation.

/ / set the earth radius

Private double WGS_84_RADIUS_EQUATOR = 6378137.0

/ / Latitude and longitude to three-dimensional coordinates

Public CVector WGS84ToWorld (CVector _ wgscood)

{

If (_ wgscood.VZ = = 0 | | Double.IsNaN (_ wgscood.VZ))

{

_ wgscood.VZ = 1

}

_ wgscood.VZ + = WGS_84_RADIUS_EQUATOR

Double tempx = 0

Double tempy = 0

Double tempz = 0

Tempy = _ wgscood.VZ * Math.Sin (_ wgscood.VY / 180 * Math.PI)

Tempx = _ wgscood.VZ * Math.Cos (_ wgscood.VY / 180 * Math.PI) * Math.Sin (_ wgscood.VX / 180 * Math.PI)

Tempz = _ wgscood.VZ * Math.Cos (_ wgscood.VY / 180 * Math.PI) * Math.Cos (_ wgscood.VX / 180 * Math.PI)

CVector rexyz = new CVector {VX = tempx, VY = tempy, VZ = tempz}

Return rexyz

}

/ / three-dimensional coordinates back to longitude and latitude

Public CVector WorldToWGS84 (CVector _ worldcood)

{

Double tempx = 0

Double tempy = 0

Double tempz = 0

If (_ worldcood.VX > = 0)

{

Tempx = Math.Acos (_ worldcood.VZ / Math.Sqrt (_ worldcood.VX * _ worldcood.VX + _ worldcood.VZ * _ worldcood.VZ)) * 180 / Math.PI

Tempx = tempx

< 0 ? tempx + 180 : tempx; } else { tempx = Math.Acos(_worldcood.VZ / Math.Sqrt(_worldcood.VX * _worldcood.VX + _worldcood.VZ * _worldcood.VZ)) * 180 / Math.PI; tempx = tempx < 0 ? -(tempx + 180) : -tempx; } tempy = Math.Asin(_worldcood.VY / Math.Sqrt(_worldcood.VX * _worldcood.VX + _worldcood.VY * _worldcood.VY + _worldcood.VZ * _worldcood.VZ)) * 180 / Math.PI; tempy = tempy >

90? 90-tempy: tempy

Tempz = (Math.Sqrt (_ worldcood.VX * _ worldcood.VX + _ worldcood.VY * _ worldcood.VY + _ worldcood.VZ * _ worldcood.VZ))-WGS_84_RADIUS_EQUATOR

CVector relonlat = new CVector {VX = tempx, VY = tempy, VZ = tempz}

Return relonlat

}

Thank you for reading! This is the end of the article on "how to realize the conversion of longitude, latitude and three-dimensional three-dimensional coordinates in big data's development. I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!

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