aboutsummaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-11-09 02:17:39 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-11-09 02:17:39 +0100
commit87a70d198b1361b6c9601e61fef6b58071bbd0a8 (patch)
tree4984b93437a13d6f9fac8876e9e39cf0a78bbebb /example.c
parent0dca2c3e51c98dfa9e62cddd32cadbf6c7f71a3d (diff)
add interactivity and shared libHEADv0.0.1master
Diffstat (limited to 'example.c')
-rw-r--r--example.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/example.c b/example.c
index af16110..ca9afa2 100644
--- a/example.c
+++ b/example.c
@@ -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);