Bounding Box Sine

Drag the red points to alter the sinusoidal function.

How are the parameters affected

period

2 π  = period * b

hshift in pi terms

B = (7.853981633974483, 1)
A = (3.141592653589793, 5)
hshift: x(A)
period: x(B) - x(A)
bval: (2 * π / period)
D: (x(B), y(A))
C: (x(A), y(B))
amp: abs((y(A) - y(C)) / 2)
vshift: y(A) - amp
f(x) = (amp * sin((bval * (x - hshift)))) + vshift
q1, a_1, c_1, b_1, d_1 = Polygon(A, C, B, D)
E = Intersect(f, a_1, (3.141592653589793, 3))
J: (x(E), y(E) - 0.01)
k: y = y(J)
F = Intersect(f, b_1, (7.853981633974483, 2.9999999999999996))
per = Segment(E, F)
G: (0, y(A))
c = Segment((0, 0), (x(A), 0))
a = Segment(E, A)
H: (x(A) + (2 * π), y(B))
I: (x(H), y(A))
q2, a_2, i, h, c_2 = Polygon(A, I, H, C)
K: (x(J) + (2 * π), y(J))
j = Segment(J, K)
M = Intersect(k, b_1)
g = Segment(M, K)
N: (0, y(E))
d = Segment((0, 0), N)
p(x) = If[x(A) ≤ x ≤ x(B), (amp * sin((bval * (x - hshift)))) + vshift]
L = Min(p, x(A), x(B))
O = Max(p, x(A), x(B))
P = Midpoint(A, B)
Q: (x(A), 0)
text2 = FractionText(hshift / π)
text1: "y = " + (LaTeX[amp]) + " \sin(" + (LaTeX[bval]) + "(x-" + (LaTeX[text2]) + " π ))+" + (LaTeX[d]) + " \\
y =  a\sin(b (x-c))+d "
text3: "y =  " + (LaTeX[amp]) + " \sin(" + (LaTeX[bval]) + "(x-" + (LaTeX[hshift]) + "))+" + (LaTeX[vshift]) + " \\
y =  a\sin(b (x-c))+d "
b = true