The invention discloses a
world map area alarm
algorithm based on a
ray method. The
algorithm comprises the following steps: S1, inputting vertexes of an area polygon to the
algorithm; s2, judging whether the input area is
clockwise or not, and if the input area is
clockwise, representing that the problem of spanning the
longitude does not occur and the input is correct; if the current position is anticlockwise, representing that a point crossing the
longitude possibly appears, and adjusting the
longitude and
latitude of the region and the longitude and
latitude of the current position to be in the same reference
system; s3, judging whether the current position is in the area or not by using a
ray method; according to the method, the
ray method is flexibly applied to the field of regional alarm of the map, user cross-
latitude regional input can be compatible, and the method is a regional alarm scheme suitable for ships, airplanes and the like under the conditions that the activity range is large and the traveling path crosses the longitude by 0 degree, has a wide application prospect and is beneficial to popularization and application.