The line segment is the portion of  y = -2x + 10
in the first quadrant. The slider changes the x
coordinate of the upper right vertex of the rectangle
along this line segment.

A = (0, 10)
B = (5, 0)
a = Segment(A, B)
xval = 2.95 (slider from 0 to 5, step 0.01)
C: (xval, 0.0)
D: (xval, 10.0 - 2.0 * xval)
E = (0, 0)
F: (0.0, 10.0 - 2.0 * xval)
Area, f, d, c, e = Polygon(F, D, C, E)