【问题标题】:Calculate coordinates of a point with given distances to two other points计算与其他两个点的给定距离的点的坐标
【发布时间】:2011-07-19 05:27:03
【问题描述】:

如果我有三个点 A、B、C,并且我知道它们之间的距离,并且 A 在二维坐标 {0,0} 处,B 在 {ab,0} 处,那么找到C点坐标?

【问题讨论】:

    标签: math coordinates distance


    【解决方案1】:

    您可以使用距离公式(基本上是勾股定理)来求坐标平面上任意两点之间的距离。

    http://www.purplemath.com/modules/distform.htm

    【讨论】:

      【解决方案2】:

      点{cx, cy} 必须解决两个方程:

      cx^2+cy^2==ac^2 && (cx-ab)^2+cy^2==bc^2
      
      => cx^2-(cx-ab)^2==ac^2-bc^2
      => 2*cx*ab==ac^2-bc^2+ab^2
      
      => cx = (ac^2-bc^2+ab^2)/(2*ab)
      
      => cy = +/- sqrt(ac^2-cx^2)   iff ac^2-cx^2 > 0
      => cy = 0   iff ac^2-cx^2 = 0
      => no solution    else
      

      有两个点都具有所需的距离。但基于ac^2-cx^2,也可能只有一种解决方案或根本没有解决方案。

      【讨论】:

        【解决方案3】:

        如果你不进一步限制距离,你的问题相当于“如何找到2个圆的交点”:

        http://mathworld.wolfram.com/Circle-CircleIntersection.html

        因此,正如霍华德所指出的,将有 0、1 或 2 个交点满足您放置的条件。

        【讨论】:

          猜你喜欢
          • 2020-02-12
          • 1970-01-01
          • 1970-01-01
          • 2023-01-26
          • 1970-01-01
          • 1970-01-01
          • 2016-02-03
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多