I am trying to generate an image of a gradient that oscillates $h$ times along the $x$-axis and $k$ times along the $y$-axis.
As an example, this image I generated below oscillates $5$ times along the $x$-axis, and $0$ times along the $y$-axis:
$f(x) = \sin(5x + 0)$
The image below on the left is the sum of two waves: one wave $(h, k) = (4, 4)$, and the other with $(h, k) = (-20, 19)$
The images I want to generate are just an array of 100x100 pixels. I can't seem to figure out how to make the wave travel diagonally. The diagonal waves cut each respective axis into a number of pieces -- this is what defines the h and k index.
To generate the one on the right, I simply made an array that is $100$ values and applied the function above on those values.
Apologies if this is the wrong forum to post on! Thank you in advance


You know that $f(x)=\sin(x)$ completes one period on $[0,2\pi]$.
Therefore $f(x)=\sin(2\pi x)$ completes one period on $[0,1]$.
Then $f(x)=\sin(2\pi hx)$ completes $h$ periods on the interval $[0,1]$.
In the plane use $f(x,y)=\sin(2\pi hx+2\pi yk)$.
On interval $[0,100]\times[0,100]$ it is $f(x,y)=\sin(200\pi hx+200\pi yk)$.