What is the average length of a line inside the unit square?

240 Views Asked by At

This question lies in the chapter exercise of chapter 14 Sampling of book: Fundamentals of Computer Graphics by Peter Shirley and Steve Marschner.

Although this is not mentioned in the question but I assume our lines are random and are uniformly distributed.

As per my current knowledge the average length here means the expected value of a function f(r, theta) which gives the length of a line (r, theta) (the line is in normal-angle space) inside the unit square [0, 1]×[0, 1]. It is possible to find such function but I am not getting what probability distribution function to use in this case.