the tall lad
https://soundcloud.com/ge
Microsoft visual,studio is gratis
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
for (int i = 0; i < 25; i++){
float x = 0;
float result = 0;
float delta = (2*3.14159265)/25;
x = i*delta;
result = sin(x);
cout << "Output = " << result << endl;
}
return 0;
}
Output = 0
Output = 0.24869
Output = 0.481754
Output = 0.684547
Output = 0.844328
Output = 0.951057
Output = 0.998027
Output = 0.982287
Output = 0.904827
Output = 0.770513
Output = 0.587785
Output = 0.368124
Output = 0.125333
Output = -0.125333
Output = -0.368125
Output = -0.587785
Output = -0.770513
Output = -0.904827
Output = -0.982287
Output = -0.998027
Output = -0.951056
Output = -0.844328
Output = -0.684547
Output = -0.481753
Output = -0.248689
------------------
(program exited with code: 0)
Press return to continue
#include <iostream>
#include <cmath>
int main() {
constexpr double pi = 3.14159265358979323846;
constexpr int n_samples = 25;
constexpr double delta = (2.0 * pi)/n_samples;
for (int i = 0; i < n_samples; i++){
double result = std::sin(i*delta);
std::cout << "Output = " << result << std::endl;
}
return 0;
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
Met C++20 kan je trouwens ook std::numbers::pi gebruiken uit <numbers>. Dat is het beste.
#include <iostream>
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
constexpr int n_samples = 25;
constexpr double delta = (2.0 * M_PI)/n_samples;
int main() {
for (int i = 0; i < n_samples; i++){
double result = std::sin(i*delta);
//std::cout << "Output = " << result << std::endl;
for (int i = 0; i < 20*result + n_samples; i++){
std::cout << '*';
}
std::cout << std::endl;
}
return 0;
}
*************************
******************************
***********************************
***************************************
******************************************
*********************************************
*********************************************
*********************************************
********************************************
*****************************************
*************************************
*********************************
****************************
***********************
******************
**************
**********
*******
******
******
******
*********
************
****************
*********************
------------------
(program exited with code: 0)
Press return to continue
#include <iostream>
#include <chrono>
#include <thread>
using namespace std;
// Driver cpde
int main()
{
cout << "Thread is running\n";
// Thread delayed for 5 seconds
this_thread::sleep_for(chrono::milliseconds(5000));
cout << "Thread was acquired for 5 seconds\n";
return 0;
}
#include <iostream>
#include <cmath>
#include <chrono>
#include <thread>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
constexpr int n_samples = 25;
constexpr int st = 1000;
constexpr double delta = (2.0 * M_PI)/n_samples;
int main() {
for (int i = 0; i < n_samples; i++){
double result = std::sin(i*delta);
//std::cout << "Output = " << result << std::endl;
for (int i = 0; i < 20*result + n_samples; i++){
std::cout << '*';
}
std::cout << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(st));
}
return 0;
}
1. Daar bestaat ook een boek over:
Heeft iemand hier dat gelezen?