Commit b6c2c871 by rakein

Upload new file

parent 4cb7dee2
Showing with 30 additions and 0 deletions
#include <math.h>
int check3Nurk(seeStruct A[], seeStruct B[], seeStruct C[], int i)
{
double ab, bc, ac;
ab = sqrt(pow((B[i].x - A[i].x), 2) + pow((B[i].y - A[i].y), 2));
bc = sqrt(pow((C[i].x - B[i].x), 2) + pow((C[i].y - B[i].y), 2));
ac = sqrt(pow((C[i].x - A[i].x), 2) + pow((C[i].y - A[i].y), 2));
if(ab >= bc && ab >= ac)
{
if(ab < bc + ac)
{
return 0;
}
} else if (bc >= ab && bc >= ac)
{
if(bc < ab + ac)
{
return 0;
}
} else if (ac >= ab && ac >= bc)
{
if(ac < ab + bc)
{
return 0;
}
}
return 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment