1 package sample;
2
3 import fi.jyu.mit.graphics.*;
4 import static java.lang.Math.*;
5
6
7
12 public class FunctionR2Sample {
13
14
18 public static class SinCos implements FunctionR2R {
19
22 public static final FunctionR2R sincos = new SinCos();
24
30 @Override
31 public double f(double x, double y) { return sin(x)*cos(y);
33 }
34 }
35
36
37
40 public static void main(String[] args) {
41 EasyWindow window = new EasyWindow();
42 window.scale(-9,-9,9,9);
43 window.addAxis(15, 15, 15);
44 window.add(new FunctionMapR2R(SinCos.sincos,-2*PI,-2*PI,2*PI,2*PI));
45 window.rotate(Axis.X, 50);
46 window.rotate(Axis.Y, 20);
47 window.showWindow();
48 window.setTouchPad(true);
50 window.setControlButtons(true);
51
52 }
53
54 }
55