public static int CompareSitesDistances_MAX(Edge edge0, Edge edge1) { float length0 = edge0.SitesDistance(); float length1 = edge1.SitesDistance(); if (length0 < length1) { return(1); } if (length0 > length1) { return(-1); } return(0); }
/* * * @return the largest circle centered at each site that fits in its region; * if the region is infinite, return a circle of radius 0. */ public List <Circle> Circles() { List <Circle> circles = new List <Circle>(); foreach (Site site in sites) { float radius = 0; Edge nearestEdge = site.NearestEdge(); if (!nearestEdge.IsPartOfConvexHull()) { radius = nearestEdge.SitesDistance() * 0.5f; } circles.Add(new Circle(site.x, site.y, radius)); } return(circles); }
public static int CompareSitesDistances_MAX(Edge edge0, Edge edge1) { float length0 = edge0.SitesDistance(); float length1 = edge1.SitesDistance(); if (length0 < length1) { return 1; } if (length0 > length1) { return -1; } return 0; }