多項式(7)
Author: 藍邦偉  老師

$ ∵f(1)=5.013,f(2)=3.987,f(4)=1.818 $

$ 設f(x)=a(x-1)(x-2)+b(x-1)+5.013 $

⇒f(2)=b+5.013=3.987⇒b=-1.026

$ ⇒f(4)=6a-1.026×3+5.013=1.818 $

⇒6a=1.818+3.078-5.013=-0.117

$ ⇒a=-\frac{0.117}{6}=-\frac{0.039}{2} $

$ ⇒f(0)=-\frac{0.039}{2}×2-1.026×(-1) +5.013=6$

$ y=f(x) $

n = 0 (slider from 0 to 8, step 1)
f(x) = -(0.039 / 2) * (x - 1) * (x - 2) - 1.026 * (x - 1) + 5.013
poly1, a, b, c, d = Polygon(Corner[1], Corner[2], Corner[3], Corner[4])
u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
A = (0, 6)