gnuplot を使おう。 その3 (946レス)
上
下
前
次
1-
新
888
:
887
2022/12/06(火)01:24
AA×
[240|
320
|
480
|
600
|
100%
|
JPG
|
べ
|
レス栞
|
レス消
]
888: 887 [sage] 2022/12/06(火) 01:24:00.71 (続き) int main () { string gnuplot_path ("gnuplot"); FILE fp (popen (gnuplot_path.c_str (), "w")); if (!fp) return -1; fprintf (fp, "reset\n"); fprintf (fp, "set yrange [-1:1]\n"); clock_t time0 (clock ()); for (double second (static_cast <double> (clock () - time0) / CLOCKS_PER_SEC); second < DURATION; second = static_cast <double> (clock () - time0) / CLOCKS_PER_SEC) { Series series; for (size_t i (0), last ((MAX - MIN) / INTERVAL); i < last; ++ i) { const double x (MIN + i * INTERVAL); series.insert (make_pair (x, sin (x - PHI + OMEGA * second))); } fprintf (fp, "set title 't = %1.2f'\n", second); fprintf (fp, "plot '-' title 'sin' with lines\n"); for (const Series::value_type &point: series) fprintf (fp, "%f %f\n", point.first, point.second); fprintf (fp, "e\n"); fflush (fp); } pclose (fp); return 0; } http://mevius.5ch.net/test/read.cgi/unix/1314242150/888
続き
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 58 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
ぬこの手
ぬこTOP
0.026s