WebEnh

.net7 mvc jquery bootstrap json 学习中 第一次学PHP,正在研究中。自学进行时... ... 我的博客 https://enhweb.github.io/ 不错的皮肤:darkgreentrip,iMetro_HD
  首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

c#计算 坐标点与坐标点之间的距离

Posted on 2023-12-22 21:47  WebEnh  阅读(62)  评论(0编辑  收藏  举报

PointF p = new PointF(116.305671f, 39.966051f);

PointF p2 = new PointF(116.595428f, 39.828327f);


double value = Math.Sqrt(Math.Abs(p.X - p2.X) * Math.Abs(p.X - p2.X) + Math.Abs(p.Y - p2.Y) * Math.Abs(p.Y - p2.Y));