private static boolean containedPlane ( Point3D_F64 T_v0 , Point3D_F64 output , Vector3D_F64 u , Vector3D_F64 v , Vector3D_F64 w0 ) { double uu , uv , vv , wu , wv , D ; uu = u . dot ( u ) ; uv = u . dot ( v ) ; vv = v . dot ( v ) ; w0 . minus ( output , T_v0 ) ; wu = w0 . dot ( u ) ; wv = w0 . dot ( v ) ; D = uv * uv - uu * vv ; // get and test parametric coords double s , t ; s = ( uv * wv - vv * wu ) / D ; if ( s < 0.0 || s > 1.0 ) // I is outside T return false ; t = ( uv * wu - uu * wv ) / D ; return ! ( t < 0.0 ) && ! ( ( s + t ) > 1.0 ) ; // I is outside T }
Determines if the point on the same plane as T is contained inside of T .