Bounding Box Sine

Drag the red points to alter the sinusoidal function.

How are the parameters a, b, c, d related to the bounding box and the sinusoid?

period

2 π  = period * b

m: x = 0
n = Ray((0, 0), (0, 1))
A = Point(n)
l: y = (-y(A))
B = Point(l)
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, (0, 0))
J: (x(E), y(E) - 0.01)
k: y = y(J)
F = Intersect(f, b_1, (3.141592653589793, -2.4492935982947064E-16))
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)
R = (3.141592653589793, 3)
e = Circle(R, amp)
S: (x(R) + amp, y(R))
q = Segment(R, S)
T = Point(e)
r = Segment(T, R)
α = Angle(S, R, T)
b: (α / ° * π / 180)
text1: "" + b + ""
s = CircleArc(R, S, T)
U: (b, 0)
o: b / bval
V: (o, 0)
t(x) = If[0 ≤ x ≤ (2 * π), sin(x)]
β: ((o / π * 180))°
S' = Rotate(S, β, R)
γ = Angle(S, R, S')
f_1 = OrthogonalLine(U, xAxis)
g_1 = OrthogonalLine(V, xAxis)
W = Intersect(t, f_1, (1.5707963267948966, 1))
Z = Intersect(p, g_1, (0.7853981633974483, 1))
u = Vector(W, Z)
e_1 = CircleArc(R, T, S')
h_1 = Segment(W, U)
i_1 = Segment(Z, V)
k_1 = CircleArc(R, S', T)