Hello! I'm currently studying Fourier Series, and our teacher asked us to develop a program that plots one. I had dabbled in SFML before and I thought it would be as good as any other platform for this task.
Without getting too much into it, the function depends on three variables, 'L', 'a' and 't'. I wanted to add three sliders beneath the graph so the user could change the value of each variable in real time. After a few hours, I got everything up and running, but there's a weird problem. The first slider, the one that controls the variable 'L', leaves artifacts on the screen when the plot becomes smaller. This doesn't happen when the graph gets bigger, or with any of the other two variables. I've tried to figure out the reason for this behavior, but I'm stumped.
I've attached pictures of this happening, and the code for the program, which can also be found here:
http://pastebin.com/dUPm93rrI've also attached the compiled file, fourier.bin.
The forum didn't allow me to attach more images, so I couldn't add the png's for the grid and the sliders, but if anyone wishes to compile this, I'll gladly share them.
Relevant data:
SFML 2.0 for linux, downloaded and installed from the ubuntu repositories.
Compiled with g++ in lubuntu
Any help will be truly appreciated.
(I apologize beforehand, I'm not a proficient programmer and the code is a little messy)