orog_mask_tools  1.5.0
 All Data Structures Files Functions Variables
enclosure_cnvx.F90 File Reference

Test whether a point is inside a spherical convex polygon. More...

Go to the source code of this file.

Functions/Subroutines

LOGICAL function enclosure_cnvx (v, n, p, co_gc)
 Test whether a given point 'p' is inside a convex spherical polygon defined with a series of 'n' vertices. More...
 

Detailed Description

Test whether a point is inside a spherical convex polygon.

Author
N Wang

Definition in file enclosure_cnvx.F90.

Function/Subroutine Documentation

LOGICAL function enclosure_cnvx ( real*8, dimension(2,n), intent(in)  v,
integer, intent(in)  n,
real*8, dimension(2), intent(in)  p,
integer, intent(out)  co_gc 
)

Test whether a given point 'p' is inside a convex spherical polygon defined with a series of 'n' vertices.

Both the test point and the polygon are specified in latitude and longitude radians. It is assumed that a side of a spherical polygon is a great-circle arc that connects 2 adjacent vertices of the polygon.

Parameters
[in]vset of vertices
[in]nnumber of vertices in v
[in]ppoint to test
[out]co_gc'i' if p is on or within epsilon to side 'i' of the given spherical polygon, or 0 if point is not on any side of the given polygon.
Returns
enclosure_cnvx whether the point is inside the polygon
Author
N Wang

Definition at line 49 of file enclosure_cnvx.F90.

Referenced by cal_lake_frac_depth().