@jonnin
Thanks, but Geogebra, when you put a number directly, its degrees, but when the number is a function of something, its radians, basically, when you put a number directly, it appends a "º" after your number, but, deleting this "º" it turns to radians, so, if you write sin(x) or sin(n), its radians, but if you write sin(3.14), it morphs to sin(3.14º), but if you delete "º", it returns the radians value.
I investigated it anyway, just to be sure, but looks fine after all investigation... :/
@lastchance
Resuming, i do musics and i'm learning maths and i'm now into this Fourier things, its useful for me, since I can make square waves from sines (but i already got a summation formula for it), I went to wikipedia and used the first formula that appears:
https://en.wikipedia.org/wiki/Fourier_series#Definition
Where the formula is, its until before section "A more general definition"...
The function s(x) is just a sin(x) on my program, that is the one i'm trying to find a fourier for, but its for learning, i'll later use another formulas...
The 16 - 32, i made because, i'm noob on c++ and i have no parsing lib yet, so, the IntgrlRAM() is integrating the "sin(x)" only, but 16 - 32 is integrating "sin(x) * cos(2 * pi * n * x)", to the integral have no conflicts with "tx" in its approximation, i made the "x" in this formula the "(m * DDiv)".
Hmm, i declared "a" and "b" in all different brackets and without "= 0" and the result is the same... :/
Sorry, i understood your reply of "fixed const" as the idea of declaring it as "= 0", sorry if i interpreted it wrong and about my "layness".
I'm noob in maths, and my idea was to use this for-tx to bring a value for each x in the formula "as = 2 * a * cos(Tau * n * tx); bs = 2 * b * sin(Tau * n * tx);".
I'll try to find a value for a single x, then i reply this topic when i do it...
EDIT: Derp, why trying to find the value of a single x?! Its the same as tx, but returning a single value, anyway, this is the print of the cout in "x = Pi":
https://imgur.com/YHafBQf
---
Anyway, thanks for the replies...