What have I done different? added by delmarre on Mon Nov 20 19:43:13 2017

Trying to build a way of testing whether a point P lies inside the shape that is a closed group of points G.

Part of doing this requires you to determine whether a point is to the left, right or on a infinite line between two points

You can see this code implemented in C++ here:

isLeft( Point P0, Point P1, Point P2 )
{
    return ( (P1.x - P0.x) * (P2.y - P0.y)
            - (P2.x -  P0.x) * (P1.y - P0.y) );
}

This is what I had

(assume vec:v-x is a procedure which returns the x part of a vector and vec:v-y gets the y part)

(define is-left?                                                                        
  (lambda (p0 p1 p2)                                                                    
   (- (* (- (vec:v-x p1) (vec:v-x p0))                                                  
         (- (vec:v-y p2) (vec:v-y p0)))                                                 
                                                                                        
       (* (- (vec:v-x p2) (vec:v-x p0))                                                 
          (- (vec:v-y p1) (vec:v-y p0)))))) 

Why is mine consistently, but in the opposite?