如何将两个WGS84坐标点精确计算交点?

2026-04-10 16:143阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计542个文字,预计阅读时间需要3分钟。

如何将两个WGS84坐标点精确计算交点?

您好,有人可以告诉我如何计算两个WGS84点的与弦的交点吗?- A点与弦,B点与弦=C点(两点的交点)+ 谢谢 + 科研,我认为您的问题是‘如何计算两条线的交点?’(简化版)

嗨,有人可以告诉我或者给我一些关于我如何计算2个WGS84点与轴承的交点的提示 –

A点轴承,B点轴承= C点(2点的交点)

非常感谢
科林

我认为你的问题是“如何计算两条线的交点?” (为简单起见,L1和L2)

你必须得到线方程y = mx q,它计算L1和L2的m和q系数,以便得到两个方程式:

y=m1x + q1
y=m2x + q2

交叉点是这个线性系统的解决方案

x = (q1 – q2) / (m2 – m1); y = m2 / (m2-m1) * (q1 – q2) + q2
// Please check the equations I writing calculating it on the fly

您的数据是椭球上的两个点和两个角度(方位):

P1=[x1; y1], bearing1 = alfa1
P2=[x2; y2], bearing1 = alfa2

您必须在平面上投影点才能使用上述线性几何体.
我想你有WGS84分:使用proj4 api.

所以现在问题是从数据中得到经典线方程.
但我们可以用极地解释来处理这些界限:

给定点P0 = [x0,y0]和角度(α),线方程P(t)是

如何将两个WGS84坐标点精确计算交点?

L(t) = [x0 + cos(alfa) * t, y0 + cos(alfa) * t ], with t in the range [-inf, + inf]

所以

L1(t) = [y1 + cos(alfa1) * t, y1 + cos (alfa1) * t] ;
L2(t) = [y2 + cos(alfa2) * t, y2 + cos (alfa2) * t] ;

解决上述系统我们有:

T = (x1- x2) / (cos(alfa2) – cos(alfa1))
X = x1 + cos(alfa1) * T
Y = y1 + sin(alfa1) * T

你的解决方案是[X,Y].

之后你必须重新投入wgs84

您可以尝试避免投影数据并直接使用p1和P2的wgs84坐标;错误可能很小但你必须检查.

(请检查一下;我是在javascript debuging的会话中写的:-)

procedure FindIntersection(x1, y2, alfa1, x2, y2, alfa2: double; out x, y: double); var t: double; begin t := (x1 - x2) / (cos(alfa2) - cos(alfa1)); x := x1 + cos(alfa1) * t; y := y1 + sin(alfa1) * t; end; (* Solution without reprojecting *)

本文共计542个文字,预计阅读时间需要3分钟。

如何将两个WGS84坐标点精确计算交点?

您好,有人可以告诉我如何计算两个WGS84点的与弦的交点吗?- A点与弦,B点与弦=C点(两点的交点)+ 谢谢 + 科研,我认为您的问题是‘如何计算两条线的交点?’(简化版)

嗨,有人可以告诉我或者给我一些关于我如何计算2个WGS84点与轴承的交点的提示 –

A点轴承,B点轴承= C点(2点的交点)

非常感谢
科林

我认为你的问题是“如何计算两条线的交点?” (为简单起见,L1和L2)

你必须得到线方程y = mx q,它计算L1和L2的m和q系数,以便得到两个方程式:

y=m1x + q1
y=m2x + q2

交叉点是这个线性系统的解决方案

x = (q1 – q2) / (m2 – m1); y = m2 / (m2-m1) * (q1 – q2) + q2
// Please check the equations I writing calculating it on the fly

您的数据是椭球上的两个点和两个角度(方位):

P1=[x1; y1], bearing1 = alfa1
P2=[x2; y2], bearing1 = alfa2

您必须在平面上投影点才能使用上述线性几何体.
我想你有WGS84分:使用proj4 api.

所以现在问题是从数据中得到经典线方程.
但我们可以用极地解释来处理这些界限:

给定点P0 = [x0,y0]和角度(α),线方程P(t)是

如何将两个WGS84坐标点精确计算交点?

L(t) = [x0 + cos(alfa) * t, y0 + cos(alfa) * t ], with t in the range [-inf, + inf]

所以

L1(t) = [y1 + cos(alfa1) * t, y1 + cos (alfa1) * t] ;
L2(t) = [y2 + cos(alfa2) * t, y2 + cos (alfa2) * t] ;

解决上述系统我们有:

T = (x1- x2) / (cos(alfa2) – cos(alfa1))
X = x1 + cos(alfa1) * T
Y = y1 + sin(alfa1) * T

你的解决方案是[X,Y].

之后你必须重新投入wgs84

您可以尝试避免投影数据并直接使用p1和P2的wgs84坐标;错误可能很小但你必须检查.

(请检查一下;我是在javascript debuging的会话中写的:-)

procedure FindIntersection(x1, y2, alfa1, x2, y2, alfa2: double; out x, y: double); var t: double; begin t := (x1 - x2) / (cos(alfa2) - cos(alfa1)); x := x1 + cos(alfa1) * t; y := y1 + sin(alfa1) * t; end; (* Solution without reprojecting *)