
int gradient1 = (y1 - y5) / (x1 - x5);
int gradient2 = (y2 - y5) / (x2 - x5);
from the image shown and the gradients calculations.. supposedly gradient1 = +ve value and gradient2 = -ve value..
but from the result i get both gradients are "0" i don't know where i have it wrong here.. if anyone could help me point out the mistake i've made.. thank you..
FroglegPosted Dec 29, 2011, 2:59 PM
int gradient1 = (y5 - y1)/(x5 - x1);
int gradient2 = (y5 - y2)/(x2 - x5);
Are you tring to detect a smile ?
If so, you only need to know if y5 is a greater distance from the top (zero) than both y1 and y2
hanna bananaPosted Dec 29, 2011, 5:28 PM