public Point projectOnto(Point loc)
	{
		Point closestPt = getClosestPoint(loc);
		double closestDist = closestPt.distance(loc);
		int closestPtInd = points.indexOf(closestPt);
		
		if (closestPtInd - 1 >= 0)
		{
			Point pt = projectOntoLineSegment(getPoint(closestPtInd - 1), closestPt, loc);
			double dist = pt.distance(loc);
			if (dist < closestDist)
			{
				closestPt = pt;
				closestDist = dist;
			}
		}
		
		if (closestPtInd + 1 < points.size())
		{
			Point pt = projectOntoLineSegment(getPoint(closestPtInd + 1), closestPt, loc);
			double dist = pt.distance(loc);
			if (dist < closestDist)
			{
				closestPt = pt;
				closestDist = dist;
			}
		}
		
		return closestPt;
	}