9
$\begingroup$

I need to be able to plot pixels in this pattern.
To me, it looks like a sine wave pattern that is both diagonal and convergent.

diagonal, convergent sine wave

What would a function for that look like? Thanks.

3 Answers 3

15

How about $x+\exp(-a x)\sin(b x)$ for suitable values of $a$ and $b$?

Here is a sample plot for $a=0.2$ and $b=10$.

  • 1
    You could add another parameter and modify the "linear" portion so that the "slope" can be adjusted; thus, $ax+\exp(-bx)\sin(cx)$2011-07-27
10

If you truly want a "rotated sine wave," you can give a parametric curve just as you state, by rotating the graph of the sine function using the $2 \times 2$ "rotation by angle $\theta$" matrix: $ c(t) = \left(\matrix{\cos \frac{\pi}{4} & -\sin \frac{\pi}{4} \\ \ \sin \frac{\pi}{4} & \cos \frac{\pi}{4}}\right) \left(\matrix{t \\ \sin t}\right) = \left(\matrix{\frac{t}{\sqrt{2}} - \frac{\sin t}{\sqrt{2}} \\ \frac{t}{\sqrt{2}} + \frac{\sin t}{\sqrt{2}}}\right)\; . $ This "transformational" approach works for rotating anything — if you're interested in computer graphics, transformation matrices are "chapter one" of nearly every book I've seen on the subject. Anyway, the above yields a curve similar to your sketch.

This curve is indeed the graph of a function — to see this, note that the derivative of the curve (obtained by taking "componentwise" derivatives of the position vector $c(t)$) is c'(t) = \left(\matrix{\frac{1}{\sqrt{2}} - \frac{\cos t}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} + \frac{\cos t}{\sqrt{2}}}\right). Thus we have a differentiable function except at the isolated points where $\frac{1}{\sqrt{2}} - \frac{\cos t}{\sqrt{2}}$ vanishes, with derivative $ \frac{\frac{1}{\sqrt{2}} + \frac{\cos t}{\sqrt{2}}}{\frac{1}{\sqrt{2}} - \frac{\cos t}{\sqrt{2}}} $ ("derivative of $y$ component divided by derivative of $x$ component" — this follows from the implicit function theorem in the present context).

That the curve remains the graph of a function where the derivative becomes infinite is clear, since the $x$ component $\frac{t}{\sqrt{2}} - \frac{\sin t}{\sqrt{2}}$ is strictly increasing, the curve must pass the "vertical line test."

As for an explicit formula, it's the image of the real line under the complex analytic map

$ z \mapsto e^{i \frac{\pi}{4}} (z + i \sin z), $

if that helps (this is essentially the vector-valued map $t \mapsto c(t)$ in different notation; for any real $\theta$, $e^{i \theta}$ is the unit-length complex number representing "counterclockwise rotation by $\theta$ radians").

If your goal is computer plotting, every tool I've seen that plots "graphs of functions" also plots parametric curves; this often gives you more control over the process, in fact, not to mention the fact that it's strictly more general. And they're certainly more "natural" in terms of geometry: consider, for instance, our "infinite derivatives" at points where the curve is perfectly well behaved, except that its tangent happens to line up with our more-or-less arbitrarily chosen coordinate axes.

-1

It looks like you want almost a staircase type of line, so use this.

f(n)=sin(x)+x

It won't let me post unless I have more characters, so I'll throw in

f(n)=sin(wx)a+dx where w is wavelength, a is amplitutde, and d is degree.

  • 0
    Welcome to MSE. For some basic information about writing mathematics at this site see, *e.g.*, [basic help on mathjax notation](/help/notation), [mathjax tutorial and quick reference](//math.meta.stackexchange.com/q/5020), [main meta site math tutorial](//meta.stackexchange.com/a/70559) and [equation editing how-to](//math.meta.stackexchange.com/q/1773).2018-07-13