public List<Vector2d> sortCornersByLengthTo(Vector2d[] corners, Vector2d v){
		List<Double> lengths = new ArrayList<Double>(corners.length);
		List<Vector2d> list = new ArrayList<Vector2d>(corners.length);
		for(int i = 0; i < corners.length; i++){
			double l = corners[i].subtract(v).getLength();
			int index = 0;
			boolean found = false;
			for(int j = 0; j < lengths.size()&&!found; j++){
				if(found = (lengths.get(j) > l))
					index = j;
			}
			if(!found){
				lengths.add(l);
				list.add(corners[i]);
			}
			else{
				lengths.add(index, l);
				list.add(index,corners[i]);
			}
		}
		return list;
	}