If I have a square of length n (the center of the square is on the origin), then if in the interior and boundary of the square, I have the point (x,y), and an angle theta, how do I get the distance of the length of the line connecting (x,y) to the edge of the square in the direction of theta?