代码之家  ›  专栏  ›  技术社区  ›  Dave Jarvis James Eichele

球面上圆的最小外接矩形

  •  2
  • Dave Jarvis James Eichele  · 技术社区  · 15 年前

    有什么R软件包可以用来计算一个大圆的最小包围盒?

    box <- polycirc( c( longitude, latitude ), distance=35 )
    

    box.longitude_min = The longitude of the circle's western-most point.
    box.longitude_max = The longitude of the circle's eastern-most point.
    box.latitude_min = The latitude of the circle's southern-most point.
    box.latitude_max = The latitude of the circle's northern-most point.
    

    像这样的东西应该已经存在于R中了,但我找不到它。我发现的最接近于R的(来自SO)是:

    http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates

    还有,这个词(如果有的话)是什么意思 ? (与…相反 circumscribed

    2 回复  |  直到 10 年前
        1
  •  1
  •   Dave Jarvis James Eichele    15 年前

    给我的:

      library( geosphere )
      p <- c( longitude, latitude )
      box <- apply( destPoint( p, c(0, 90, 180, 270), distance ), 2, range )
      print( box )
    
        2
  •  0
  •   nico    15 年前

    polycirc min max 找到边界框:)

    require(pgirmess)
    circle <- polycirc(20, c(10, 20))
    plot(circle, type = "l")
    rect(min(circle[,1]), min(circle[,2]), max(circle[,1]), max(circle[,2]))