惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
V
V2EX
Martin Fowler
Martin Fowler
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
博客园 - 【当耐特】
Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
K
Kaspersky official blog
Security Latest
Security Latest
H
Help Net Security
博客园_首页
美团技术团队
Spread Privacy
Spread Privacy
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
G
Google Developers Blog
NISL@THU
NISL@THU
爱范儿
爱范儿
I
Intezer
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Hacker News: Ask HN
Hacker News: Ask HN
I
InfoQ
The Cloudflare Blog
F
Full Disclosure
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium

博客园 - MaxIE

jQuery选择器和选取方法 为什么Android的图片质量会比iPhone的差? .net下BerkeleyDB操作封装C#版(附单元测试) MS SQL SERVER索引优化相关查询 SSD在SQLServer中的应用 Speech两种使用方法 让.net程序自动运行在管理员权限下 “请求的操作无法在使用用户映射区域打开的文件上执行”问题处理 C#随机字符串随机性不足的解決方式(随机数重复) json.net处理复杂json 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 解决办法 excel中根据单元格背景颜色进行数据筛选(excel2003实现方法) 跨平台加密版 SQLite 3 - wxSQLite3 数据库sql2000错误8908及处理 jQuery2011年年度最佳插件 jQ中文API离线版下载(适用版本1.4.4,1.5,1.5.1,1.5.2,1.6,1.6.1,1.6.2) 方便的CSS和jQuery下拉菜单解决方案 sql2000无法执行查询及未找到提供程序解决办法 SQL Server优化SELECT语句方法
百度地图计算两坐标点之间距离计算
MaxIE · 2014-08-15 · via 博客园 - MaxIE

public class BaiDuMap {

    static double DEF_PI = 3.14159265359

        static double DEF_2PI= 6.28318530712

        static double DEF_PI180= 0.01745329252

        static double DEF_R =6370693.5

        public static double GetShortDistance(double lon1, double lat1, double lon2, double lat2)

        {

            double ew1, ns1, ew2, ns2;

            double dx, dy, dew;

            double distance;

            ew1 = lon1 * DEF_PI180;

            ns1 = lat1 * DEF_PI180;

            ew2 = lon2 * DEF_PI180;

            ns2 = lat2 * DEF_PI180;

            dew = ew1 - ew2;

            if (dew > DEF_PI)

            dew = DEF_2PI - dew;

            else if (dew < -DEF_PI)

            dew = DEF_2PI + dew;

            dx = DEF_R * Math.cos(ns1) * dew; 

            dy = DEF_R * (ns1 - ns2); 

            distance = Math.sqrt(dx * dx + dy * dy);

            return distance;

        }

        public static double GetLongDistance(double lon1, double lat1, double lon2, double lat2)

        {

            double ew1, ns1, ew2, ns2;

            double distance;

            ew1 = lon1 * DEF_PI180;

            ns1 = lat1 * DEF_PI180;

            ew2 = lon2 * DEF_PI180;

            ns2 = lat2 * DEF_PI180;

            distance = Math.sin(ns1) * Math.sin(ns2) + Math.cos(ns1) * Math.cos(ns2) * Math.cos(ew1 - ew2);

            if (distance > 1.0)

                 distance = 1.0;

            else if (distance < -1.0)

                  distance = -1.0;

            distance = DEF_R * Math.acos(distance);

            return distance;

        }

        public static void main(String[] args) {

            double mLat1 = 39.90923

            double mLon1 = 116.357428

            double mLat2 = 39.90923;

            double mLon2 = 116.397428;

            double distance = BaiDuMap.GetShortDistance(mLon1, mLat1, mLon2, mLat2);

            System.out.println(distance);

        }

}