If I have 3 points on a plane in 3D Space,

P(x1, y1, z1)

P(x2, y2, z2)

P(x3, y3, z3)

Is there any function which takes the parameter as the co-ordinate of the 3 points and returns the x, y , z component of vector perpendicular to the plane?

If I have 3 points on a plane in 3D Space,

P(x1, y1, z1)

P(x2, y2, z2)

P(x3, y3, z3)

Is there any function which takes the parameter as the co-ordinate of the 3 points and returns the x, y , z component of vector perpendicular to the plane?

Three points is a triangle, and itâ€™s very easy to find the normal of one of those.

cross(P3-P1, P2-P1)

OR

cross(P2-P1, P3-P1)

Those will calculate normals pointing in opposite directions.