How to set coordinate range via V3 GPS/GPRS/GSM shield?

Hi all,Can give any idea to set the range of 2D coordinate so that we can send mssg immediately if the tracked person exceed the set range , like idea below:

char lon_out[11]={'1','0','3','2','5','.','9','1','6','0','1'}; if(array1>=lat_out) { digitalWrite(ledPin2,LOW); range_out(); }
However, I stuck now.

Thanks ,JJQ

Hi JJQ,

The longitude and latitude are numbers and should be compared as such. We mention this because in your example you are using a char array (lon_out) to store what appears to be a longitude.
By performing a quick online search, we found the following information about determining if a lon/lat position is inside a specified region:

  1. stackoverflow.com/questions/12083093/how-to-define-if-a-determinate-point-is-inside-a-region-lat-long
  2. stackoverflow.com/questions/10651764/ios-lat-long-within-rectangle
  3. stackoverflow.com/questions/4287780/detecting-whether-a-gps-coordinate-falls-within-a-polygon-on-a-map
    Please note that we did not review this information fully and cannot offer more support on it.

In general, finding if a point is inside a region relates to general geometry principles. You may want to read the following:

  1. en.wikipedia.org/wiki/Point_in_polygon
  2. stackoverflow.com/questions/481144/equation-for-testing-if-a-point-is-inside-a-circle

You may also want to read more about how the longitude and latitude relate an actual position on Earth:

  1. en.wikipedia.org/wiki/Geographic_coordinate_system#Geographic_latitude_and_longitude

Sincerely,