Hi all, I’m trying to understand how the barycentric coordinates implement on CCV’s callibration. I’ve tried to close look on the CCV’s source code and found the calibration proses on http://ccv.nuigroup.com/docs/1.3/_calibration_utils_8cpp_source.html. I read it each line on source code and tried to understand, but I’m stuck on understand this code

```
bool CalibrationUtils::isPointInTriangle(vector2df p, vector2df a, vector2df b, vector2df c)
```

{

if (vector2df::isOnSameSide(p,a, b,c) && vector2df::isOnSameSide(p,b, a,c) && vector2df::isOnSameSide(p, c, a, b))

return true;

else

return false;

}

I know that code above is boolean funtion to check whether the point is in triangle area or not. But how the algorithm to know that. I found “isOnSameSide” function declaration is in vector2d.h

```
static bool isOnSameSide(vector2d<T> p1, vector2d<T> p2, vector2d<T> a, vector2d<T> b)
```

{

vector2d<T> ba = b - a;

float cp1 = ba.crossProduct(p1-a);

float cp2 = ba.crossProduct(p2-a);

if (cp1*cp2 >= 0.0f)

return true;

else

return false;

}

But I still don’t understand what’s the meaning with those vector on the same side. Somebody can help me?