Notes
![]() ![]() Notes - notes.io |
#include <math.h>
#define W 800
#define H 600
#define D 20
float* generuj(int ile)
{
float* tmp;
tmp = new float[ile];
// standardowo w przypadku błędu new zgłasza tak zwany wyjątek - jego obsługi nauczycie się w przyszłym semestrze
return tmp;
}
int main()
{
int A=1;
float T=0.1;
int f=100;
float fp=10000;
int N=T*fp+1;
float *y;
float *czas;
y=generuj(N);
czas=generuj(N);
float Ax;
float Bx;
float Ay;
float By;
Bx=D;
Ax=(W-2*D)/T;
Ay=(H-2*D)/-2*A;
By=D-Ay*A;
float t;
int i=0;
for(t=0;t<=T;t+=1/fp){
y[i]=A*sin(2*M_PI*f*t);
czas[i]=t;
i++;
}
sf::VertexArray plunkty(sf::Points);
for(i=0;i<=N;i++){
plunkty.append(sf::Vector2f(Ax*czas[i]+Bx,Ay*y[i]+By));}
sf::VertexArray pulunkt(sf::Points);
pulunkt.append (sf::Vector2f(400,300));
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
sf::VertexArray lines(sf::LinesStrip, 5);
lines[0].position = sf::Vector2f(D, D);
lines[1].position = sf::Vector2f(W-D, D);
lines[2].position = sf::Vector2f(W-D, H-D);
lines[3].position = sf::Vector2f(D, H-D);
lines[4].position = sf::Vector2f(D, D);
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed)
window.close();
}
// Clear screen
window.clear();
window.draw(lines);
window.draw(plunkty);
window.draw(pulunkt);
// Update the window
window.display();
}
return EXIT_SUCCESS;
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team