尊敬的先生/女士:
代码:
#define PI 3.1415926
#define M 0.4
双 θ= 0;
Theta-= 100 * PI *(PERIOD_COUNT / 10000.0);
//********* sector1********* //
if (theta>=0 && theta<(PI/6)||theta>=(11*PI/6)&& theta<=(2*PI))
{
D1 = 1/3+(2/PI)*M * cos (theta);
D3 = 1/3+(2/PI)*M * cos (theta+(2*PI/3));
D5 = 1/3+(2/PI)*M * cos (theta-(2*PI/3));
对于上述代码行、我的预期输出为
当 θ 为0至30度时、D1值从0.587降至0.553、而当 θ 为330至360 度时、D1值从0.553降至0.587
当 θ 为0至30度时、D3的值在0.2060至0.1128之间变化、而当 θ 为330至360 度时、D3的值在0.333至0.206之间变化
当 θ 为0至30度时、D5值在0.206至0.3333之间变化 、而当 θ 为330至360 度时、D5值在0.333至0.206之间变化
但我在观察窗口中得到以下值
D1在0.2546至0.2231之间变化(θ 为0至30度)
D3在-0.1273至-0.2178之间变化 (θ 为0至30度)
D5在 -0.1273至-0.0053之间变化 (θ 为0至30度)
请帮助我解决此问题