*x = Ax * rx + Bx * ry + Cx;
*y = Ay * ry + By * rx + Cy;
printf("--%hd,%hd,%hd,%hd \r\n",*x,*y,rx,ry);
}
static void _draw_cross(uint16_t x, uint16_t y)
{
x -= 10;
for(uint16_t i = 0; i < 20; i++)
{
Lcd_DrawPixel(x + i, y,Red);
}
x += 10;
y -= 10;
for(uint16_t i = 0; i < 20; i++)
{
Lcd_DrawPixel(x, y + i,Red);
}
}
static void calculate(int X1, int Y1, int C1,
int X2, int Y2, int C2,
int X3, int Y3, int C3,
double *A ,double *B ,double *C)
{
double a = X1;
double b = Y1;
double c = 1;
double d = C1;
double e = X2;
double f = Y2;
double g = 1;
double h = C2;
double i = X3;
double j = Y3;
double k = 1;
double l = C3;
//<!--EVALUATING THE DELTA DETERMINANT -->
double delta = (a*f*k)+(b*g*i)+(c*e*j)-(c*f*i)-(a*g*j)-(b*e*k);
//<!--EVALUATING THE X NUMERATOR & ANSWER -->
double xnum = (d*f*k)+(b*g*l)+(c*h*j)-(c*f*l)-(d*g*j)-(b*h*k);
double xans = xnum/delta;
*A = xans;
//<!--EVALUATING THE Y NUMERATOR & ANSWER -->
double ynum = (a*h*k)+(d*g*i)+(c*e*l)-(c*h*i)-(a*g*l)-(d*e*k);
double yans = ynum/delta;
*B = yans;
//<!--EVALUATING THE Z NUMERATOR & ANSWER -->
double znum = (a*f*l)+(b*h*i)+(d*e*j)-(d*f*i)-(a*h*j)-(b*e*l);
double zans = znum/delta;
*C = zans;
}