fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5. double a = 0.227;
  6. double w = 3.34;
  7. double fase = 2.55;
  8. double c = 0.388;
  9.  
  10. double t;
  11. double y;
  12.  
  13. // Genera i dati per il grafico
  14. for (int i = 0; i <= 400; i++) {
  15. t = (double)i / 100.0; // Intervallo di tempo da 0 a 4 secondi
  16. y = a * sin(w * t + fase) + c;
  17. printf("%lf, %lf\n", t, y); // Stampa i valori di tempo e posizione
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
0.000000, 0.514594
0.010000, 0.508231
0.020000, 0.501735
0.030000, 0.495111
0.040000, 0.488368
0.050000, 0.481513
0.060000, 0.474553
0.070000, 0.467497
0.080000, 0.460352
0.090000, 0.453127
0.100000, 0.445829
0.110000, 0.438466
0.120000, 0.431048
0.130000, 0.423581
0.140000, 0.416074
0.150000, 0.408536
0.160000, 0.400976
0.170000, 0.393400
0.180000, 0.385819
0.190000, 0.378240
0.200000, 0.370672
0.210000, 0.363124
0.220000, 0.355603
0.230000, 0.348118
0.240000, 0.340678
0.250000, 0.333291
0.260000, 0.325964
0.270000, 0.318707
0.280000, 0.311527
0.290000, 0.304432
0.300000, 0.297431
0.310000, 0.290530
0.320000, 0.283739
0.330000, 0.277063
0.340000, 0.270512
0.350000, 0.264091
0.360000, 0.257809
0.370000, 0.251672
0.380000, 0.245687
0.390000, 0.239860
0.400000, 0.234199
0.410000, 0.228710
0.420000, 0.223398
0.430000, 0.218270
0.440000, 0.213331
0.450000, 0.208587
0.460000, 0.204043
0.470000, 0.199704
0.480000, 0.195575
0.490000, 0.191661
0.500000, 0.187966
0.510000, 0.184494
0.520000, 0.181249
0.530000, 0.178235
0.540000, 0.175455
0.550000, 0.172911
0.560000, 0.170608
0.570000, 0.168547
0.580000, 0.166731
0.590000, 0.165162
0.600000, 0.163841
0.610000, 0.162771
0.620000, 0.161951
0.630000, 0.161384
0.640000, 0.161070
0.650000, 0.161008
0.660000, 0.161200
0.670000, 0.161645
0.680000, 0.162342
0.690000, 0.163292
0.700000, 0.164491
0.710000, 0.165940
0.720000, 0.167637
0.730000, 0.169580
0.740000, 0.171766
0.750000, 0.174193
0.760000, 0.176859
0.770000, 0.179760
0.780000, 0.182894
0.790000, 0.186256
0.800000, 0.189844
0.810000, 0.193652
0.820000, 0.197678
0.830000, 0.201915
0.840000, 0.206360
0.850000, 0.211008
0.860000, 0.215853
0.870000, 0.220891
0.880000, 0.226114
0.890000, 0.231519
0.900000, 0.237097
0.910000, 0.242844
0.920000, 0.248753
0.930000, 0.254818
0.940000, 0.261031
0.950000, 0.267385
0.960000, 0.273874
0.970000, 0.280490
0.980000, 0.287227
0.990000, 0.294075
1.000000, 0.301029
1.010000, 0.308079
1.020000, 0.315219
1.030000, 0.322440
1.040000, 0.329734
1.050000, 0.337093
1.060000, 0.344508
1.070000, 0.351973
1.080000, 0.359477
1.090000, 0.367013
1.100000, 0.374573
1.110000, 0.382147
1.120000, 0.389729
1.130000, 0.397308
1.140000, 0.404877
1.150000, 0.412427
1.160000, 0.419949
1.170000, 0.427436
1.180000, 0.434880
1.190000, 0.442270
1.200000, 0.449601
1.210000, 0.456862
1.220000, 0.464047
1.230000, 0.471147
1.240000, 0.478154
1.250000, 0.485061
1.260000, 0.491859
1.270000, 0.498542
1.280000, 0.505101
1.290000, 0.511529
1.300000, 0.517820
1.310000, 0.523966
1.320000, 0.529961
1.330000, 0.535797
1.340000, 0.541468
1.350000, 0.546968
1.360000, 0.552290
1.370000, 0.557430
1.380000, 0.562380
1.390000, 0.567136
1.400000, 0.571692
1.410000, 0.576043
1.420000, 0.580184
1.430000, 0.584111
1.440000, 0.587820
1.450000, 0.591305
1.460000, 0.594563
1.470000, 0.597592
1.480000, 0.600386
1.490000, 0.602943
1.500000, 0.605261
1.510000, 0.607337
1.520000, 0.609167
1.530000, 0.610751
1.540000, 0.612087
1.550000, 0.613172
1.560000, 0.614007
1.570000, 0.614589
1.580000, 0.614919
1.590000, 0.614995
1.600000, 0.614818
1.610000, 0.614388
1.620000, 0.613706
1.630000, 0.612772
1.640000, 0.611587
1.650000, 0.610153
1.660000, 0.608471
1.670000, 0.606543
1.680000, 0.604372
1.690000, 0.601958
1.700000, 0.599307
1.710000, 0.596419
1.720000, 0.593299
1.730000, 0.589951
1.740000, 0.586376
1.750000, 0.582581
1.760000, 0.578568
1.770000, 0.574343
1.780000, 0.569910
1.790000, 0.565275
1.800000, 0.560441
1.810000, 0.555415
1.820000, 0.550202
1.830000, 0.544809
1.840000, 0.539240
1.850000, 0.533503
1.860000, 0.527604
1.870000, 0.521548
1.880000, 0.515344
1.890000, 0.508998
1.900000, 0.502517
1.910000, 0.495908
1.920000, 0.489178
1.930000, 0.482336
1.940000, 0.475389
1.950000, 0.468344
1.960000, 0.461209
1.970000, 0.453993
1.980000, 0.446703
1.990000, 0.439348
2.000000, 0.431936
2.010000, 0.424474
2.020000, 0.416972
2.030000, 0.409437
2.040000, 0.401879
2.050000, 0.394305
2.060000, 0.386724
2.070000, 0.379144
2.080000, 0.371575
2.090000, 0.364023
2.100000, 0.356499
2.110000, 0.349009
2.120000, 0.341563
2.130000, 0.334169
2.140000, 0.326835
2.150000, 0.319569
2.160000, 0.312379
2.170000, 0.305274
2.180000, 0.298261
2.190000, 0.291348
2.200000, 0.284543
2.210000, 0.277854
2.220000, 0.271287
2.230000, 0.264850
2.240000, 0.258551
2.250000, 0.252396
2.260000, 0.246393
2.270000, 0.240547
2.280000, 0.234866
2.290000, 0.229356
2.300000, 0.224022
2.310000, 0.218872
2.320000, 0.213910
2.330000, 0.209142
2.340000, 0.204574
2.350000, 0.200211
2.360000, 0.196057
2.370000, 0.192117
2.380000, 0.188395
2.390000, 0.184897
2.400000, 0.181625
2.410000, 0.178583
2.420000, 0.175774
2.430000, 0.173202
2.440000, 0.170870
2.450000, 0.168780
2.460000, 0.166935
2.470000, 0.165336
2.480000, 0.163986
2.490000, 0.162885
2.500000, 0.162036
2.510000, 0.161439
2.520000, 0.161094
2.530000, 0.161002
2.540000, 0.161164
2.550000, 0.161579
2.560000, 0.162246
2.570000, 0.163165
2.580000, 0.164335
2.590000, 0.165754
2.600000, 0.167422
2.610000, 0.169335
2.620000, 0.171492
2.630000, 0.173891
2.640000, 0.176528
2.650000, 0.179402
2.660000, 0.182508
2.670000, 0.185843
2.680000, 0.189404
2.690000, 0.193187
2.700000, 0.197186
2.710000, 0.201399
2.720000, 0.205819
2.730000, 0.210443
2.740000, 0.215265
2.750000, 0.220280
2.760000, 0.225481
2.770000, 0.230864
2.780000, 0.236423
2.790000, 0.242150
2.800000, 0.248040
2.810000, 0.254086
2.820000, 0.260282
2.830000, 0.266620
2.840000, 0.273093
2.850000, 0.279695
2.860000, 0.286417
2.870000, 0.293253
2.880000, 0.300194
2.890000, 0.307233
2.900000, 0.314363
2.910000, 0.321574
2.920000, 0.328860
2.930000, 0.336211
2.940000, 0.343621
2.950000, 0.351080
2.960000, 0.358580
2.970000, 0.366113
2.980000, 0.373670
2.990000, 0.381243
3.000000, 0.388824
3.010000, 0.396404
3.020000, 0.403974
3.030000, 0.411527
3.040000, 0.419053
3.050000, 0.426545
3.060000, 0.433994
3.070000, 0.441392
3.080000, 0.448729
3.090000, 0.456000
3.100000, 0.463194
3.110000, 0.470305
3.120000, 0.477323
3.130000, 0.484242
3.140000, 0.491054
3.150000, 0.497751
3.160000, 0.504325
3.170000, 0.510770
3.180000, 0.517077
3.190000, 0.523241
3.200000, 0.529254
3.210000, 0.535109
3.220000, 0.540800
3.230000, 0.546321
3.240000, 0.551665
3.250000, 0.556826
3.260000, 0.561799
3.270000, 0.566579
3.280000, 0.571159
3.290000, 0.575535
3.300000, 0.579701
3.310000, 0.583654
3.320000, 0.587389
3.330000, 0.590901
3.340000, 0.594187
3.350000, 0.597243
3.360000, 0.600065
3.370000, 0.602651
3.380000, 0.604997
3.390000, 0.607102
3.400000, 0.608962
3.410000, 0.610575
3.420000, 0.611941
3.430000, 0.613056
3.440000, 0.613920
3.450000, 0.614533
3.460000, 0.614893
3.470000, 0.614999
3.480000, 0.614853
3.490000, 0.614453
3.500000, 0.613801
3.510000, 0.612897
3.520000, 0.611742
3.530000, 0.610337
3.540000, 0.608685
3.550000, 0.606786
3.560000, 0.604643
3.570000, 0.602259
3.580000, 0.599636
3.590000, 0.596776
3.600000, 0.593684
3.610000, 0.590362
3.620000, 0.586815
3.630000, 0.583045
3.640000, 0.579058
3.650000, 0.574859
3.660000, 0.570450
3.670000, 0.565838
3.680000, 0.561028
3.690000, 0.556025
3.700000, 0.550834
3.710000, 0.545462
3.720000, 0.539914
3.730000, 0.534196
3.740000, 0.528316
3.750000, 0.522279
3.760000, 0.516092
3.770000, 0.509762
3.780000, 0.503297
3.790000, 0.496703
3.800000, 0.489987
3.810000, 0.483158
3.820000, 0.476223
3.830000, 0.469189
3.840000, 0.462065
3.850000, 0.454858
3.860000, 0.447577
3.870000, 0.440229
3.880000, 0.432823
3.890000, 0.425367
3.900000, 0.417869
3.910000, 0.410338
3.920000, 0.402782
3.930000, 0.395209
3.940000, 0.387628
3.950000, 0.380048
3.960000, 0.372477
3.970000, 0.364923
3.980000, 0.357395
3.990000, 0.349901
4.000000, 0.342449