coding UTF-8; // Load libraries. import Math; import GUI; import tool.Graph3D; // Parameters of the wave. double amplitude = 0.85; double wavelength = 2.0; double period = 1.5; // Paerameters for plotting the graph. const int N = 100; // The number of grid points, for X/Y directions of the 3D mesh. const double X_MIN = -5.0; // The min value of the x-axis of the graph. const double X_MAX = 5.0; // The max value of the x-axis of the graph. const double Y_MIN = -5.0; // The min value of the y-axis of the graph. const double Y_MAX = 5.0; // The max value of the y-axis of the graph. const double Z_MIN = -1.0; // The min value of the z-axis of the graph. const double Z_MAX = 1.0; // The max value of the z-axis of the graph. const double DT = 0.1; // One step of the discrete time (when the speed=1.0) const double DX = (X_MAX - X_MIN) / (N-1); // One step of the discrete x values. const double DY = (Y_MAX - Y_MIN) / (N-1); // One step of the discrete y values. // Arrays storing x/y/z coordinates of the grid points of the 3D mesh, for plotting the graph. double waveX[ N ][ N ]; double waveY[ N ][ N ]; double waveZ[ N ][ N ]; // Variables for storing IDs of tje GUI components. int window; int periodSlider; int wavelengthSlider; int amplitudeSlider; int speedSlider; int infoLabel; int timeLabel; int resetButton; // Other variables. float speed = 0.7; // The speed of the animation. int graph; // Stores ID of the 3D graph software (RINEARN Graph 3D). bool continuesLoop = true; // The flag representing whether the main loop continues/exits. double t; // The variable representing time. // ================================================================================ // The main function, which will be invoked automatically when the program starts. // ================================================================================ void main( ){ // Launch the 3D graph software (RINEARN Graph 3D). createGraphWindow(); // Create the window, and initializes the GUI components. createSettingWindow(); // The main loop. t = 0.0; while( continuesLoop ) { // Compute coordinates of grid points of the 3D mesh to be plotted on the graph. for( int yi=0; yi