I am trying to fit a sine function to a general curve. Convolution isn't giving me what I want, which is for every point on a general curve, displace that point by another function. I have written some code in Octave, and it's close, but not quite it.
What I did was to take a general function, take it's derivative at each point, took the inverse reciprocal for the slope of the perpendicular line to that point, set the distance to the point I wanted, then put the perpendicular line in point slope for to solve for the points of interest. The plot come close, but at the derivative approaches zero, so do the perpendicular points.
(1) tan line: y-z=f'(theta)*(x-theta)
(2) perp line: y-z=(-1/f'(theta))*(x-theta)
solve for y in (2) and sub into (3)
Solve for x
Then sub into perpendicular point slope form and solve for y.
#plot(theta,z)#un-comment for general plot.