<legend id='PxDAv'><style id='PxDAv'><dir id='PxDAv'><q id='PxDAv'></q></dir></style></legend>

    1. <tfoot id='PxDAv'></tfoot>

      • <bdo id='PxDAv'></bdo><ul id='PxDAv'></ul>

      <small id='PxDAv'></small><noframes id='PxDAv'>

      <i id='PxDAv'><tr id='PxDAv'><dt id='PxDAv'><q id='PxDAv'><span id='PxDAv'><b id='PxDAv'><form id='PxDAv'><ins id='PxDAv'></ins><ul id='PxDAv'></ul><sub id='PxDAv'></sub></form><legend id='PxDAv'></legend><bdo id='PxDAv'><pre id='PxDAv'><center id='PxDAv'></center></pre></bdo></b><th id='PxDAv'></th></span></q></dt></tr></i><div id='PxDAv'><tfoot id='PxDAv'></tfoot><dl id='PxDAv'><fieldset id='PxDAv'></fieldset></dl></div>

    2. 在圆中寻找坐标

      Finding a coordinate in a circle(在圆中寻找坐标)

      <i id='noKcG'><tr id='noKcG'><dt id='noKcG'><q id='noKcG'><span id='noKcG'><b id='noKcG'><form id='noKcG'><ins id='noKcG'></ins><ul id='noKcG'></ul><sub id='noKcG'></sub></form><legend id='noKcG'></legend><bdo id='noKcG'><pre id='noKcG'><center id='noKcG'></center></pre></bdo></b><th id='noKcG'></th></span></q></dt></tr></i><div id='noKcG'><tfoot id='noKcG'></tfoot><dl id='noKcG'><fieldset id='noKcG'></fieldset></dl></div>

          • <bdo id='noKcG'></bdo><ul id='noKcG'></ul>
          • <small id='noKcG'></small><noframes id='noKcG'>

                <tbody id='noKcG'></tbody>
              <legend id='noKcG'><style id='noKcG'><dir id='noKcG'><q id='noKcG'></q></dir></style></legend>

            1. <tfoot id='noKcG'></tfoot>
              • 本文介绍了在圆中寻找坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在使用 Grails 下的 Google 地图进行混搭,用户可以通过选择创建 geofences地图上的一个点和一个半径.这会存储在我的数据库中,并且应用程序会不断从 GPS 设备接收一组坐标.

                I am doing a mashup using Google Maps under Grails where users can create geofences by selecting a point on the map and a radius. This get stored on my database and the application receives constantly a set of coordinates from a GPS device.

                我想将接收到的坐标与圆圈中存储的区域进行比较.如果该点在圆圈内(或外),程序将触发一个动作.但是,我想知道如何确定坐标是否位于圆的内部/外部.有一个 Javascript 库可以执行此操作,但我需要在服务器上执行此操作.

                I would like to compare the received coordinates with the area stored in the circles. If the point is inside (or outside) the circle the program will fire an action. However, I would like to know how I can find out if the coordinates are located inside/outside the circle. There is a Javascript library which allows doing this but I need to do this on the server.

                是否有用于此的 Java(甚至 Groovy)库?你将如何实现它?

                Is there a Java (or even Groovy) library for this? How would you implement it?

                推荐答案

                如果圆心的距离是<= 圆的半径 那么它在圆圈内.
                如果该区域由多个圆圈组成,而不是与所有圆圈相比......它不会花费那么长时间.

                if distance from point to center of circle is <= radius of circle then it is inside the circle.
                if the area is made of more than one circle than compare to all the circles... it won't take that long.

                java.awt.geom.Point2D.Double 非常适合.

                java.awt.geom.Point2D.Double is perfect for this.

                这篇关于在圆中寻找坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                How to convert Integer to int?(如何将整数转换为整数?)
                How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                Inconsistent behavior on java#39;s ==(java的行为不一致==)
                Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)
                  <tfoot id='QN0hk'></tfoot>

                      <small id='QN0hk'></small><noframes id='QN0hk'>

                      • <legend id='QN0hk'><style id='QN0hk'><dir id='QN0hk'><q id='QN0hk'></q></dir></style></legend>
                          <tbody id='QN0hk'></tbody>
                        <i id='QN0hk'><tr id='QN0hk'><dt id='QN0hk'><q id='QN0hk'><span id='QN0hk'><b id='QN0hk'><form id='QN0hk'><ins id='QN0hk'></ins><ul id='QN0hk'></ul><sub id='QN0hk'></sub></form><legend id='QN0hk'></legend><bdo id='QN0hk'><pre id='QN0hk'><center id='QN0hk'></center></pre></bdo></b><th id='QN0hk'></th></span></q></dt></tr></i><div id='QN0hk'><tfoot id='QN0hk'></tfoot><dl id='QN0hk'><fieldset id='QN0hk'></fieldset></dl></div>

                          <bdo id='QN0hk'></bdo><ul id='QN0hk'></ul>