Overview Schemas Index

GEOMETRY_SCHEMA (jsdai.SGeometry_schema)


FUNCTION same_side
          (plane_pts : LIST [3:3] OF cartesian_point, test_points : LIST [2:?] OF cartesian_point) : BOOLEAN;

LOCAL
     val1, val2 : REAL;
     n          : INTEGER;
   END_LOCAL;

   IF  (plane_pts[1].dim = 2) OR (test_points[1].dim = 2) THEN
     RETURN(?);
   END_IF;
   n := SIZEOF(test_points);
   val1 := above_plane(plane_pts[1], plane_pts[2], plane_pts[3],
                       test_points[1] );
   REPEAT i := 2 TO n;
     val2 := above_plane(plane_pts[1], plane_pts[2], plane_pts[3],
                       test_points[i] );
     IF (val1*val2 <= 0.0) THEN
       RETURN(FALSE);
     END_IF;
   END_REPEAT;
   RETURN(TRUE);

END_FUNCTION; -- same_side

public class FSame_side
          public static Value run(SdaiContext _context, Value plane_pts, Value test_points)