34 if((byte_high & (1 << 7)) == (1 << 7))
36 num = (byte_low + (byte_high << 8)) - 0xFFFF;
40 num = byte_low + (byte_high << 8);
57 num = byte_low + (byte_high << 8);
80 *byte_high = (num >> 8) & 0xFF;
81 *byte_low = (num) & 0xFF;
93 static double V1, V2, S;
101 double U1 = (double)rand() / RAND_MAX;
102 double U2 = (double)rand() / RAND_MAX;
106 S = V1 * V1 + V2 * V2;
107 }
while(S >= 1 || S == 0);
109 X = V1 * sqrt(-2 * log(S) / S);
113 X = V2 * sqrt(-2 * log(S) / S);
118 return X * sigma + mu;
130 return exp(- (pow((mu - x), 2)) / (pow(sigma, 2)) / 2.0) / sqrt(M_PI * 2 * (pow(sigma, 2)));
143 return pow(x1 - x2, 2) + pow(y1 - y2, 2);
161 float t = ((x - p1[0]) * (p2[0] - p1[0]) + (y - p1[1]) * (p2[1] - p1[1])) / l2;
169 return general_dist_squared(x, y, (p1[0] + t * (p2[0] - p1[0])), (p1[1] + t * (p2[1] - p1[1])));
249 for(i = 0; i < len; i++)
void general_circle_four_points(int **arr, int cx, int cy, int x, int y)
float general_dist_squared(int x1, int y1, int x2, int y2)
float general_dist2seg(int x, int y, int p1[], int p2[])
double general_gaussrand(double mu, double sigma)
unsigned int general_bytes2uint(unsigned char byte_high, unsigned char byte_low)
void general_int2bytes(int integer, unsigned char *byte_high, unsigned char *byte_low)
void general_circle(int **arr, int cx, int cy, int radius)
int general_bytes2int(unsigned char byte_high, unsigned char byte_low)
void general_circle_eight_points(int **arr, int cx, int cy, int x, int y)
float general_gaussian(float mu, float sigma, int x)
void general_circle_horizontal_line(int **arr, int x, int y, int len)