public CellIndex ClosestBoundaryCell(IEnumerable <CellIndex> lst, Vector3 p, Dictionary <CellIndex, float> distanceFromStart) { return(FUtils.ArgMinStruct(lst, cellIndex => TotalDistance(cellIndex, p, distanceFromStart)).Value); }
public CellIndex ClosestCell(IEnumerable <CellIndex> lst, Vector3 p) { return(FUtils.ArgMinStruct(lst, cellIndex => (p - positions[cellIndex]).magnitude).Value); }