diff options
Diffstat (limited to 'example.c')
| -rw-r--r-- | example.c | 35 |
1 files changed, 14 insertions, 21 deletions
@@ -42,31 +42,24 @@ Scalar sincos_scalar(double x) { } int main() { - Plot2d sin_plot; - sin_plot.func = sin_scalar; - sin_plot.from = -1; - sin_plot.to = 5; - sin_plot.step = 0.001; + Function group1[] = { + FUNC_AUTO(sin_scalar), + FUNC_AUTO(cos_scalar), + }; - Plot2d cos_plot; - cos_plot.func = cos_scalar; - cos_plot.from = -1; - cos_plot.to = 5; - cos_plot.step = 0.001; + Function group2[] = { + FUNC_AUTO(tan_scalar), + }; - Plot2d tan_plot; - tan_plot.func = tan_scalar; - tan_plot.from = -1; - tan_plot.to = 5; - tan_plot.step = 0.001; + Function group3[] = { + FUNC_AUTO(sincos_scalar), + }; - Plot2d sincos_plot; - sincos_plot.func = sincos_scalar; - sincos_plot.from = 0; - sincos_plot.to = 100; - sincos_plot.step = 0.01; + Plot2d plot1 = PLOT_AUTO(group1); + Plot2d plot2 = PLOT_AUTO(group2); + Plot2d plot3 = PLOT_AUTO(group3); - Plot2dGroup * group = create_plot2d_group(4, sin_plot, cos_plot, tan_plot, sincos_plot); + Plot2dGroup * group = create_plot2d_group(4, plot1, plot2, plot3); plot(group); free_plot2d_group(group); |