public static class Figures\r
{\r
\r
- public static void drawGrating(double wavelength, double contrast, double orientation, double phase)\r
- {\r
- double freq = 2 * Math.PI / wavelength;\r
- Canvas.default_buffer.ForEach(\r
- (x, y) => new Color(.5 + .5 * Math.sin(phase + (Math.sin(orientation) * x - Math.cos(orientation) * y) * freq))\r
- );\r
- }\r
-\r
public static void drawGrating(ref Image img, int width, int height, double wavelength, double contrast, double orientation, double phase)\r
{\r
double width_half = width / 2.0, height_half = height / 2.0;\r