# Partial surface area of right trapezoid.

I'm trying to get a formula for $x_2$ coordinate of right trapezoid ABCD, which surface area equals $s$, given $(x_0, y_o)$ and $(x_1, y_1)$.

I arrived to this equation: $$\frac a2x_2^2 + (y_0-ax_0)x_2 - y_0x_0 + \frac a2x_0^2 - s = 0$$ where $a = (y_1-y_0)/(x_1-x_0)$.

When I try to solve it with some test values, I'm getting a negative determinant, which indicates that my equation is incorrect. Where is the error?

I derived my equation from: $$s = (x_2-x_0)(y_2+y_0)/2$$ and $$y_2 = y_0 + a(x_2-x_0)$$

by substituting $y_2$ in the first one.

EDIT

The test values I'm using are: $(x_0, y_0) = (1, 1); (x_1, y_1) = (2, 0.1); s = 0.4$, which result in $-0.45x_2^2 + 1.9x_2 - 2.05 = 0$ equation with $-0.08$ determinant.

• It would be easier for others to spot the error if you show how you derived your equation. – Travis Willse Mar 1 '16 at 11:40
• @Travis I edited my question with more detail, thanks. – Paul Jurczak Mar 1 '16 at 11:48
• Seems to me that your reasoning and calculus is correct. Can you show which test values you took? – Martigan Mar 1 '16 at 11:57
• @Martigan I added the test values. – Paul Jurczak Mar 1 '16 at 12:33
• It seems to me that your third term is wrong: I have $-1.85$ and not $-2.05$... – Martigan Mar 1 '16 at 12:56

Direct integration of area under straight line

$$y = y_0 + a ( x -x_0) ; \; a = \frac{y_1-y_0}{x_1-x_0}$$

$$s = (x_2-x_0) \cdot ( y_0+ \frac {a}{2} (x_2-x_0)) \tag1$$

Imagine average height mid-way between AD and BC. The Trapezium Formula is

$$Base\cdot Average Height$$

$$s = AB \cdot \frac{(AD+BC)}{2}\tag2$$

where each term corresponds with 1).

• Shouldn't the line equation be offset, to give $y = y_0 + a (x - x_0)$? – Travis Willse Mar 1 '16 at 12:18