Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 16:45:38 +0000



Post From: Ehlers Roofing filter

[2017-06-21 13:41:56]
michelh - Posts: 159
thanks ehlaban,

just a quick question - I know that your code is correct but i have a question about coding concepts.


his definition of alpha (TS code) is:

alpha1 = (Cosine(.707*360 / HPPeriod) + Sine (.707*360 /
HPPeriod) - 1) / Cosine(.707*360 / HPPeriod);

Your code reads:
float tr, fi;
    tr = 360 * 3.14159f / 180;
    fi = 0.707f * tr / Bars.GetInt();
    alpha1 = (cos(fi) + sin(fi) - 1) / cos(fi);

so you have introduced an extra factor of 2 pi into the sin/cos in defining alpha.
Why did you have to do this?
And why didn't you write tr = 2 * 3.14f? why did you do the 360/180?


When I coded it myself, I got nothing but gibberish in the output. But if you have 2 minutes to write me a note to tell me why you had to do it like this, that would be appreciated.

Many thanks,

Michel