public double segmentDistanceTo(Point p )
	{
		double leftMost; 
		double rightMost;
		
		double lowest;
		double highest;
		
		if (p1.x < p2.x)
		{
			leftMost = p1.x;
			rightMost = p2.x;
		}
		else
		{
			leftMost = p2.x;
			rightMost = p1.x;
		}
		
		if (p1.y < p2.y )
		{
			highest = p1.y;
			lowest = p2.y;
		}
		
		else
			
		{
			highest = p2.y;
			lowest = p1.y;
		}
		
		if ((p.y > lowest && p.y < highest) && (p.x > leftMost && p.x < rightMost) )
		{
			return distanceTo(p);
		}
		else
		{
			return p.distanceTo(p2);
		}
		
		
		
		
		
		
	}