coding Shift_JIS; // 文字コードの明示(文字化け予防) import Math; // 数学関数の使用に必要なライブラリの読み込み import GUI; // GUI画面の構築に必要なライブラリの読み込み import tool.Graph3D; // 3次元グラフ描画に必要なライブラリの読み込み // 以下、波のパラメータを格納する変数 double amplitude = 1.0; // 波の振幅(A) double wavelength = 2.0; // 波の波長(λ) double period = 1.0; // 波の周期(T) // グラフ範囲や点数、時間刻みなどの設定変数 const int N = 100; // メッシュの一方向あたりの格子点数(細かいほど滑らか) const double X_MIN = -5.0; // グラフのX軸の最小値 const double X_MAX = 5.0; // グラフのX軸の最大値 const double Y_MIN = -5.0; // グラフのY軸の最小値 const double Y_MAX = 5.0; // グラフのY軸の最大値 const double Z_MIN = -1.0; // グラフのZ軸の最小値 const double Z_MAX = 1.0; // グラフのZ軸の最大値 const double DT = 0.1; // 1ループごとの時間進行量(speed=1.0の時の値) const double DX = (X_MAX - X_MIN) / (N-1); // メッシュのX軸方向の刻み幅 const double DY = (Y_MAX - Y_MIN) / (N-1); // メッシュのY軸方向の刻み幅 // グラフに波のデータを渡すための座標値配列 double waveX[ N ][ N ]; // X座標の配列 double waveY[ N ][ N ]; // Y座標の配列 double waveZ[ N ][ N ]; // Z座標の配列 // GUI(設定画面)用の変数 int window; // ウィンドウのIDを格納する int periodSlider; // 周期設定スライダーのIDを格納する int wavelengthSlider; // 波長設定スライダーのIDを格納する int amplitudeSlider; // 振幅設定スライダーのIDを格納する int speedSlider; // アニメーション速度スライダーのIDを格納する int infoLabel; // 設定値を表示するラベルのIDを格納する int timeLabel; // 時刻表示ラベルのIDを格納する int resetButton; // 時刻リセットボタンのIDを格納する // その他の制御用変数 float speed = 0.7; // アニメーション速度 int graph; // グラフソフトのIDを格納する bool continuesLoop = true; // アニメーションON/OFF制御変数 double t; // 時刻変数 // ================================================== // 中心的な処理 - この関数は起動時に自動で実行されます // ================================================== void main( ){ // グラフを起動 createGraphWindow(); // GUI(設定画面)を構築 createSettingWindow(); t = 0.0; // 時刻変数 // アニメーションのループ while( continuesLoop ) { // グラフソフトに渡す点列データの座標を計算 for( int yi=0; yi