/* Calculate pole location for lowpass at frequency 1 */
{
- gdouble angle = (M_PI / 2.0) * (2.0 * p - 1) / np;
+ gdouble angle = (G_PI / 2.0) * (2.0 * p - 1) / np;
rp = -sin (angle);
ip = cos (angle);
/* Calculate zero location for frequency 1 on the
* unit circle for type 2 */
if (type == 2) {
- gdouble angle = M_PI / (np * 2.0) + ((p - 1) * M_PI) / (np);
+ gdouble angle = G_PI / (np * 2.0) + ((p - 1) * G_PI) / (np);
gdouble mag2;
iz = cos (angle);
gdouble a, b, d;
gdouble alpha, beta;
gdouble w0 =
- 2.0 * M_PI * (filter->lower_frequency /
+ 2.0 * G_PI * (filter->lower_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble w1 =
- 2.0 * M_PI * (filter->upper_frequency /
+ 2.0 * G_PI * (filter->upper_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
if (filter->mode == MODE_BAND_PASS) {
/* gain is H(wc), wc = center frequency */
gdouble w1 =
- 2.0 * M_PI * (filter->lower_frequency /
+ 2.0 * G_PI * (filter->lower_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble w2 =
- 2.0 * M_PI * (filter->upper_frequency /
+ 2.0 * G_PI * (filter->upper_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble w0 = (w2 + w1) / 2.0;
gdouble zr = cos (w0), zi = sin (w0);
np + 1, 1.0, 0.0)));
{
gdouble w1 =
- 2.0 * M_PI * (filter->lower_frequency /
+ 2.0 * G_PI * (filter->lower_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble w2 =
- 2.0 * M_PI * (filter->upper_frequency /
+ 2.0 * G_PI * (filter->upper_frequency /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble w0 = (w2 + w1) / 2.0;
gdouble zr, zi;
/* Calculate pole location for lowpass at frequency 1 */
{
- gdouble angle = (M_PI / 2.0) * (2.0 * p - 1) / np;
+ gdouble angle = (G_PI / 2.0) * (2.0 * p - 1) / np;
rp = -sin (angle);
ip = cos (angle);
/* Calculate zero location for frequency 1 on the
* unit circle for type 2 */
if (type == 2) {
- gdouble angle = M_PI / (np * 2.0) + ((p - 1) * M_PI) / (np);
+ gdouble angle = G_PI / (np * 2.0) + ((p - 1) * G_PI) / (np);
gdouble mag2;
iz = cos (angle);
{
gdouble k, d;
gdouble omega =
- 2.0 * M_PI * (filter->cutoff / GST_AUDIO_FILTER (filter)->format.rate);
+ 2.0 * G_PI * (filter->cutoff / GST_AUDIO_FILTER (filter)->format.rate);
if (filter->mode == MODE_LOW_PASS)
k = sin ((1.0 - omega) / 2.0) / sin ((1.0 + omega) / 2.0);
#ifndef GST_DISABLE_GST_DEBUG
{
gdouble wc =
- 2.0 * M_PI * (filter->cutoff /
+ 2.0 * G_PI * (filter->cutoff /
GST_AUDIO_FILTER (filter)->format.rate);
gdouble zr = cos (wc), zi = sin (wc);
if (rate == 0)
return;
- C = exp (-2 * M_PI * filter->filter_width / rate);
- B = -4 * C / (1 + C) * cos (2 * M_PI * filter->filter_band / rate);
+ C = exp (-2 * G_PI * filter->filter_width / rate);
+ B = -4 * C / (1 + C) * cos (2 * G_PI * filter->filter_band / rate);
A = sqrt (1 - B * B / (4 * C)) * (1 - C);
filter->A = A;
(self->mode == MODE_BAND_PASS) ? "band-pass" : "band-reject");
/* fill the lp kernel */
- w = 2 * M_PI * (self->lower_frequency / GST_AUDIO_FILTER (self)->format.rate);
+ w = 2 * G_PI * (self->lower_frequency / GST_AUDIO_FILTER (self)->format.rate);
kernel_lp = g_new (gdouble, len);
for (i = 0; i < len; ++i) {
if (i == len / 2)
/ (i - len / 2);
/* Windowing */
if (self->window == WINDOW_HAMMING)
- kernel_lp[i] *= (0.54 - 0.46 * cos (2 * M_PI * i / len));
+ kernel_lp[i] *= (0.54 - 0.46 * cos (2 * G_PI * i / len));
else
kernel_lp[i] *=
- (0.42 - 0.5 * cos (2 * M_PI * i / len) +
- 0.08 * cos (4 * M_PI * i / len));
+ (0.42 - 0.5 * cos (2 * G_PI * i / len) +
+ 0.08 * cos (4 * G_PI * i / len));
}
/* normalize for unity gain at DC */
kernel_lp[i] /= sum;
/* fill the hp kernel */
- w = 2 * M_PI * (self->upper_frequency / GST_AUDIO_FILTER (self)->format.rate);
+ w = 2 * G_PI * (self->upper_frequency / GST_AUDIO_FILTER (self)->format.rate);
kernel_hp = g_new (gdouble, len);
for (i = 0; i < len; ++i) {
if (i == len / 2)
/ (i - len / 2);
/* Windowing */
if (self->window == WINDOW_HAMMING)
- kernel_hp[i] *= (0.54 - 0.46 * cos (2 * M_PI * i / len));
+ kernel_hp[i] *= (0.54 - 0.46 * cos (2 * G_PI * i / len));
else
kernel_hp[i] *=
- (0.42 - 0.5 * cos (2 * M_PI * i / len) +
- 0.08 * cos (4 * M_PI * i / len));
+ (0.42 - 0.5 * cos (2 * G_PI * i / len) +
+ 0.08 * cos (4 * G_PI * i / len));
}
/* normalize for unity gain at DC */
(self->mode == MODE_LOW_PASS) ? "low-pass" : "high-pass");
/* fill the kernel */
- w = 2 * M_PI * (self->cutoff / GST_AUDIO_FILTER (self)->format.rate);
+ w = 2 * G_PI * (self->cutoff / GST_AUDIO_FILTER (self)->format.rate);
kernel = g_new (gdouble, len);
kernel[i] = sin (w * (i - len / 2)) / (i - len / 2);
/* windowing */
if (self->window == WINDOW_HAMMING)
- kernel[i] *= (0.54 - 0.46 * cos (2 * M_PI * i / len));
+ kernel[i] *= (0.54 - 0.46 * cos (2 * G_PI * i / len));
else
- kernel[i] *= (0.42 - 0.5 * cos (2 * M_PI * i / len) +
- 0.08 * cos (4 * M_PI * i / len));
+ kernel[i] *= (0.42 - 0.5 * cos (2 * G_PI * i / len) +
+ 0.08 * cos (4 * G_PI * i / len));
}
/* normalize for unity gain at DC */
#endif
opmap[OP_SPIRAL1][i] = ((guint)
- ((at / M_PI * 256) + (r * 4000))) & 255;
+ ((at / G_PI * 256) + (r * 4000))) & 255;
j = r * 300 / 32;
rr = r * 300 - j * 32;
j *= 64;
j += (rr > 28) ? (rr - 28) * 16 : 0;
opmap[OP_SPIRAL2][i] = ((guint)
- ((at / M_PI * 4096) + (r * 1600) - j)) & 255;
+ ((at / G_PI * 4096) + (r * 1600) - j)) & 255;
opmap[OP_PARABOLA][i] =
((guint) (yy / (xx * xx * 0.3 + 0.1) * 400)) & 255;
gdouble omega;
if (freq / rate >= 0.5)
- omega = M_PI;
+ omega = G_PI;
else if (freq <= 0.0)
omega = 0.0;
else
- omega = 2.0 * M_PI * (freq / rate);
+ omega = 2.0 * G_PI * (freq / rate);
return omega;
}
gdouble bw = 0.0;
if (band->width / rate >= 0.5) {
- /* If bandwidth == 0.5 the calculation below fails as tan(M_PI/2)
+ /* If bandwidth == 0.5 the calculation below fails as tan(G_PI/2)
* is undefined. So set the bandwidth to a slightly smaller value.
*/
- bw = M_PI - 0.00000001;
+ bw = G_PI - 0.00000001;
} else if (band->width <= 0.0) {
/* If bandwidth == 0 this band won't change anything so set
* the coefficients accordingly. The coefficient calculation
band->b1 = 0.0;
band->b2 = 0.0;
} else {
- bw = 2.0 * M_PI * (band->width / rate);
+ bw = 2.0 * G_PI * (band->width / rate);
}
return bw;
}
data->h_height = info->screen.height;
for (i = 0; i < NB_THETA; i++) {
- radian = 2 * i * M_PI / NB_THETA;
+ radian = 2 * i * G_PI / NB_THETA;
h = (0.2 + cos (radian) / 15.0 * sin (radian * 2.0 + 12.123)) * screen_coef;
data->h_cos[i] = 0x10000 * (-h * cos (radian) * cos (radian));
data->h_sin[i] = 0x10000 * (h * sin (radian + 1.57) * sin (radian));
Cur->c_y = Gauss_Rand (goomInfo, 0.0, .8, 4.0);
Cur->r = Gauss_Rand (goomInfo, F->r_mean, F->dr_mean, 3.0);
Cur->r2 = Half_Gauss_Rand (goomInfo, 0.0, F->dr2_mean, 2.0);
- Cur->A = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0);
- Cur->A2 = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0);
+ Cur->A = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (G_PI / 180.0);
+ Cur->A2 = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (G_PI / 180.0);
Cur++;
}
}
for (i = 0; i < 512; i++) {
l[i].x = ((float) i * rx) / 512.0f;
l[i].y = param;
- l[i].angle = M_PI / 2.0f;
+ l[i].angle = G_PI / 2.0f;
}
return;
case GML_VLINE:
for (i = 0; i < 512; i++) {
float cosa, sina;
- l[i].angle = 2.0f * M_PI * (float) i / 512.0f;
+ l[i].angle = 2.0f * G_PI * (float) i / 512.0f;
cosa = param * cos (l[i].angle);
sina = param * sin (l[i].angle);
l[i].x = ((float) rx / 2.0f) + cosa;
/* statics from pretty_move */
float distt;
float distt2;
- float rot; /* entre 0 et 2 * M_PI */
+ float rot; /* entre 0 et 2 * G_PI */
int happens;
int rotation;
int lock;
data->distt = 10.0f;
data->distt2 = 0.0f;
- data->rot = 0.0f; /* entre 0 et 2 * M_PI */
+ data->rot = 0.0f; /* entre 0 et 2 * G_PI */
data->happens = 0;
data->rotation = 0;
*dist = fx_data->distt = (tmp + 3.0f * fx_data->distt) / 4.0f;
if (!fx_data->happens) {
- tmp = M_PI * sin (cycle) / 32 + 3 * M_PI / 2;
+ tmp = G_PI * sin (cycle) / 32 + 3 * G_PI / 2;
} else {
fx_data->rotation =
goom_irand (goomInfo->gRandom,
500) ? fx_data->rotation : goom_irand (goomInfo->gRandom, 2);
if (fx_data->rotation)
- cycle *= 2.0f * M_PI;
+ cycle *= 2.0f * G_PI;
else
- cycle *= -1.0f * M_PI;
- tmp = cycle - (M_PI * 2.0) * floor (cycle / (M_PI * 2.0));
+ cycle *= -1.0f * G_PI;
+ tmp = cycle - (G_PI * 2.0) * floor (cycle / (G_PI * 2.0));
}
- if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot + 2.0 * M_PI))) {
- fx_data->rot = (tmp + 15.0f * (fx_data->rot + 2 * M_PI)) / 16.0f;
- if (fx_data->rot > 2.0 * M_PI)
- fx_data->rot -= 2.0 * M_PI;
+ if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot + 2.0 * G_PI))) {
+ fx_data->rot = (tmp + 15.0f * (fx_data->rot + 2 * G_PI)) / 16.0f;
+ if (fx_data->rot > 2.0 * G_PI)
+ fx_data->rot -= 2.0 * G_PI;
*rotangle = fx_data->rot;
- } else if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot - 2.0 * M_PI))) {
- fx_data->rot = (tmp + 15.0f * (fx_data->rot - 2.0 * M_PI)) / 16.0f;
+ } else if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot - 2.0 * G_PI))) {
+ fx_data->rot = (tmp + 15.0f * (fx_data->rot - 2.0 * G_PI)) / 16.0f;
if (fx_data->rot < 0.0f)
- fx_data->rot += 2.0 * M_PI;
+ fx_data->rot += 2.0 * G_PI;
*rotangle = fx_data->rot;
} else
*rotangle = fx_data->rot = (tmp + 15.0f * fx_data->rot) / 16.0f;
* a better result than given from the rectangular window
*/
for (i = 0; i < 32; i++)
- filter_kernel[i] *= (0.54 - 0.46 * cos (2 * M_PI * i / 32));
+ filter_kernel[i] *= (0.54 - 0.46 * cos (2 * G_PI * i / 32));
va = g_value_array_new (1);
gdouble x;
if (rate / 2.0 > CUTOFF)
- x = exp (-2.0 * M_PI * (CUTOFF / rate));
+ x = exp (-2.0 * G_PI * (CUTOFF / rate));
else
x = 0.0;