Date: 27 September 2013

x

sketch derivative

xmin = -6
xmax = 6
dy = 0.1
y2 = 3
y1 = 2
ymax = 4
ymin = -5
xbuffer = 0.3
dx: (xmax - xmin) / 3
mm1: (y2 - y1) / dx
x4: xmax
x3: xmin + (2 * dx)
x2: xmin + dx
x1: xmin
y3 = -1
y4 = 0
a = PolyLine((x1, y1), (x2, y2), (x3, y3), (x4, y4))
mm2: (y3 - y2) / dx
mm3: (y4 - y3) / dx
m1options: mm1 + Sequence[i, i, ceil(ymin - mm1), floor(ymax - mm1), dy]
z1 = 1
xs1: ((3 * x1) + x2) / 4
xs2: (x1 + (3 * x2)) / 4
xs3: ((3 * x2) + x3) / 4
xs4: (x2 + (3 * x3)) / 4
xs5: ((3 * x3) + x4) / 4
xs6: (x3 + (3 * x4)) / 4
M1a = Point(Zip[(x1, a), a, m1options])
m2options: mm2 + Sequence[i, i, ceil(ymin - mm2), floor(ymax - mm2), dy]
m3options: mm3 + Sequence[i, i, ceil(ymin - mm3), floor(ymax - mm3), dy]
M1b = Point(Zip[(x2, a), a, m1options])
M2a = Point(Zip[(x2, a), a, m2options])
M2b = Point(Zip[(x3, a), a, m2options])
M3a = Point(Zip[(x3, a), a, m3options])
M3b = Point(Zip[(x4, a), a, m3options])
m1a: y(M1a)
m1b: y(M1b)
m2a: y(M2a)
m2b: y(M2b)
m3a: y(M3a)
m3b: y(M3b)
m1acorrect: m1a ≟ mm1
m1bcorrect: m1b ≟ mm1
m2acorrect: m2a ≟ mm2
m2bcorrect: m2b ≟ mm2
m3acorrect: m3a ≟ mm3
m3bcorrect: m3b ≟ mm3
text1: "" + (LaTeX[xlabel]) + ""
fderiv1 = Segment((x1, mm1), (x2, mm1))
fderiv2 = Segment((x2, mm2), (x3, mm2))
fderiv3 = Segment((x3, mm3), (x4, mm3))
showcorrect = false
A = Point(a)
S1 = Segment((x1, y(M1a)), (x2, y(M1b)))
S2 = Segment((x2, y(M2a)), (x3, y(M2b)))
S3 = Segment((x3, y(M3a)), (x4, y(M3b)))
sketchderivative = false