I have this C# Method that Determine that a point is inside a polygon or not
C# Method is this:
/// <summary>
/// Determine that a point in inside a polygon or not
/// </summary>
/// <param name="points">Points of Polygon</param>
/// <param name="point">Test Point</param>
/// <returns></returns>
Public bool IsInside(List<PointF> points,PointF point )
{
int i, j,n=points.Count;
bool c = false;
for (i = 0, j = n - 1; i < n; j = i++)
{
if (((points[i].Y > point.Y) != (points[j].Y > point.Y)) &&
(point.X <
(points[j].X - points[i].X)*(point.Y - points[i].Y)/(points[j].Y - points[i].Y) + points[i].X))
c = !c;
}
return c;
}
How can i convert this to a SQL Function or StoredProcedure?
STContainsgeometry::STGeomFromTextfunction.