# Area of irregular polygon

I am looking for a bit of guidance in deriving the example case in Project Euler 587. That is, the irregular triangle (highlighted in orange) occupies 36.46% of entire triangle formed in the lower left corner (the shaded section + the triangle above it) or 36.46% of the L-section as described in the problem.

I'm quite confused on how to derive the 36.46%. I'm going to walk through what I've tried to do below, it's a bit complicated and I'm not sure if it's the right approach so feel free to suggest another route.

Fair warning I'm haven't used MathJax annotations before so I'll try my best to keep it organized.

What I've tried where r = radius

• The L-section is obviously $r^2 - (\pi r^2)/4$

• The hard part that I seem to be doing wrong is how to calculate the shaded region. I tried to split the graphic in half. So the line goes from bottom left to middle right. Then calculate the area of entire triangle formed along the base, the hypotenuse being the entire line, and the height being the base up to middle. Then the shaded area = [Area of this triangle] - [bottom right L-section] - [area of circular segment in that triangle]

So the area of that first triangle = $(bh)/2$ = $(2r)(r)/2$ = $r^2$

Area of bottom right L-section = same as bottom left (?) = $r^2 - (\pi r^2)/4$

Area of circular segment, this is one I had to do some research. I found some relevant formulas on wikipedia and this formula to calculate length of the secant.

So calculating the length of the secant, I used the $AB^2 = AC*AD$ to find the top left length of the shaded region, subtracted from the hypotenuse of the triangle = secant length.

So hypotenuse = $\sqrt{5r^2}$

Tangent length = $r$

So then $r^2 = x * \sqrt{5r^2}$ where x = length of top right of shaded region.

which $= r^2 / {\sqrt{5r^2}}$

so secant length = [hypotenuse] - [top right of shaded region] = $\sqrt{5r^2}$ - $(r^2 / {\sqrt{5r^2}})$

Then using a formula from wikipedia to find the central angle of the circular segment in radians

$2 * arcsin(c/(2r))$, where c = secant length, r = radius

Using 5 for r (i'm going to use equal sign since I don't know the symbol for approx.)

secant length = 8.94

circular segment central angle = 2.21 radians

Now using the formula from wikipedia for area of circular segmant

$A = (r^2 / 2) * (a - sin(a))$, where r = radius, a = angle

So area of circular segment = 17.59

So using r = 5,

L-section = 5.37

Large triangle area = 25

Shaded region = [triangle] - [L-section] - [circular segment] = 2.04

Ratio = $2.04 / 5.37 = 37.99$%

This is close to 36.46% but the error of margin is too high to solve the problem.

Anyone have any insight into why I can't calculate the area of the shaded region properly? Thanks

• This might help you why ...... math.stackexchange.com/questions/1874736/… $And -also- this:$ mindyourdecisions.com/blog/2016/08/07/… – Seyed Feb 4 '17 at 0:09
• Thanks I'll have a look at those. 6th graders, lol rip my ego – jeffer son Feb 4 '17 at 0:30
• It appears that second link is exactly what I'm looking for. However it solves for the shaded region using exactly the same method, just different formulas for the circular segment. So not sure if the formulas I used from wikipedia were wrong or I used them incorrectly. – jeffer son Feb 4 '17 at 18:42