# Area of a sector between a point and a function determined by an angle

I've been trying to find a way to do this: given a point $P(\alpha,\beta)$, a function $f(x)$, and an angle $\theta$, find the area of the sector determined by extending a horizontal line from $P$ to $f$, and then another one from $P$ to $f$ at the angle $\theta$ from the first line. If you look at this picture:

it's a little more clear what I'm talking about. I want to find the area of that sector $S$, which is determined by that triangle $R_1$ and the other region $R_2$. Let the value of $x$ where the horizontal line from $P$ hits $f$ be $q$ (that is, $q=f^{-1}(\beta)$). Now, the line $\overline{PA}$ has the equation $y=\tan\theta(x-\alpha)+\beta$. The intersection of that and $f$, the point $A$ (the first intersection point), is the beginning of the interval determining $R_2$; I'll call the root $p$ of $f(x)=\tan\theta(x-\alpha)+\beta$ that value of $x$, so $p=f^{-1}(\tan\theta(x-\alpha)+\beta)$. The area of $R_1$ is simply the area of the triangle: $R_1=\frac{1}{2}(p-\alpha)(f(p)-\beta)$. The area of $R_2$ is the area under the curve from $p$ to $q$, minus the initial height $\beta$: $R_2=\displaystyle\int_p^q (f(x)-\beta) dx$. Therefore, the total area is $$S=\frac{1}{2}\tan\theta(p-\alpha)^2-\beta(q-p)+\displaystyle\int_p^q f(x) dx$$

This is the way I did it, but there has to be a simpler way; is there one involving polar equations? Is there a general formula when $f$ is non-invertible?

Edit: If the function $f$ is translated so that $P$ is now the origin, the area is just $\displaystyle\frac{1}{2}\int_0^\theta r^2 d\phi$ where $r(\phi)$ is $f(x)$ in polar form. However, translating $f$ over to where $P$ is on the origin turns it into $f(x+\alpha)-\beta$. Is there a nice way of putting that into polar form?

-
Note that the line at angle $\theta$ could intersect your function many times. Presumably you want to stop at the first intersection...? – Joseph O'Rourke Oct 11 '10 at 20:29
yes, that is what I meant. I'll add that in. – Eugene Bulkin Oct 11 '10 at 20:48

Yes, it is easier using polar coordinates. If you have a region in the plane determined by two straight lines $OA$ and $OB$ starting in a point $O$ -like those in your picture- and forming angles $\theta_1$ and $\theta_2$ with respect the $x$-axis ($OB$ doesn't need to be horizontal) and you close your region with a curve which polar equation is $r = r(\theta )$, then you apply the change of variables theorem, and you have

$$A(D) = \int_D dxdy = \int_{\theta_1}^{\theta_2} \int_0^{r(\theta)} rdrd\theta = \frac{1}{2} \int_{\theta_1}^{\theta_2} r(\theta)^2 d\theta \ .$$

Here $D$ is your sector and $A(D)$ its area.

For instance, if you want to compute the area of a circle of radius $R$ (you already know, but just in case...), $r(\theta ) = R$. Hence

$$A(D) = \frac{1}{2}\int_0^{2\pi} R^2d\theta = \pi R^2 \ .$$

Amazing, isn't it? :-)

So the only problem could be that your data necessarily start with the equation of the curve given in Cartesain coordinates $y = f(x)$ and you have to translate it into polar coordinates.

-
Since the point $P$ can be anywhere, getting the area from the origin would require translating $f(x)$; it would turn it into $y'=f(x+\alpha)-\beta$; then the integral would go from 0 to $\theta$, so it wouldn't be that bad. However, it's the conversion of $y'$ to polar that I want to find in a general form if possible. – Eugene Bulkin Oct 11 '10 at 20:51
@Eugene: Translating points is a bloody mess in polar coordinates, you're always better off doing translations in Cartesian before converting to polar coordinates and applying Agusti's formulation. – J. M. Oct 11 '10 at 22:23
yeah, that is true, but is there a general conversion from cartesian to polar that accounts for translation? or is it too complicated to write out here? – Eugene Bulkin Oct 13 '10 at 1:55