Point cannot be inside or outside of a polygon. It can lie on it or be on one of its sides (based on the polygon's normal vector).
Here is how you do it with simple words:
Polygons are composed of triangles. If your polygon is planar you take the first triangle and build transformation matrix from its points.
This is how we get orthogonal vectors from the 3 points of the triangle
v1 = p3-p1
v2 = p2-p1
v1 = normalize(v1 ^ v2)
v3 = normalize(v1 ^ v2)
v2 = normalize(v1 ^ v3)
These vectors will be used to build a matrix below. They define its orientation. But we will need and the positional data for that matrix. You can use one of the points of the triangle for that or find the barycenter. In the most real world cases barycenter is the way to go. Here is how you find it:
v4 = p1*0.3333+p2*0.3333+p3*0.3333
Build a matrix from these vectors, different applications may have different ordering of the xform matrix but i assume we are talking Maya here
| v1.x v1.y v1.z 0 |
matrix =| v2.x v2.y v2.z 0 |
| v3.x v3.y v3.z 0 |
| v4.x v4.y v4.z 1 |
Because we are talking Maya here the triangles of mesh objects usually come with normals already associated to them. I like to assemble the matrix in a way that its Y axis coincides with the normal vector of the triangle.
You can think of that matrix representing the triangle as transform object in Maya. You can think of the point you have as another transform object.
Now to figure out on which side of the triangle (polygon) this point lies you have to "parent" it under that imaginary transform object defined by the matrix. And then check if the local "Y" position of the point is positive or negative. If positive the point is "outside" (using your wording) of the polygon, otherwise it is on the opposite side, or "inside".
* <-point
y
| <- matrix
|
z_____ x |
| <-triangle's normal vector
|
---------------------------------------- <-triangle from the side
To find the coordinates of the point in the local space of the matrix you have to multiply its coordinates by the inverse matrix:
v = p * inverseMatrix
if v.y > 0 point is on the side defined by the triangle's normal
if v.y < 0 point is on the other side
if v.y == 0 point lies on the plane defined by the triangle.
Now if your polygon is non-planar things get more interesting. You will have to find the closest point on the surface of the polygon to your point. Then figure out which of the polygon's triangles this point is inside and run the test above for that triangle. While you can do that all by yourself this brute force method is too slow for real tools. You will need some sort of accelerated lookup method - octree or kdtree. Luckily Maya provides such. Take a look at the MMeshIntersector class.
It goes like this:
MPointOnMesh pomi;
MMeshIntersector meshIntersector;
meshIntersector.create(oMyMeshGeo);
meshIntersector.getClosestPoint(pMyPoint, pomi, 99999999.9);
pomi.triangleIndex(); // triangle ID
Let me know if something is not clear.