If I have these two geofences, after registering these geofences I should get notified when I\'m entering or exiting the circumference of these circles. However, I don\'t wa
very schematically:
boolean isTransition1, isTransition2, isTransition, insideCircle1, insideCircle2, insideUnion, insideUnionPrev;
if (isTransition1 | isTransition2) {
insideCircle1 = (dist(currPosition, centerCircle1) < radius1);
insideCircle2 = (dist(currPosition, centerCircle2) < radius2);
insideUnionPrev = insideUnion;
insideUnion = insideCircle1 | insideCircle;
isTransition = (insideUnion != insideUnionPrev);
if (isTransition & insideUnion) println("Moved into region");
if (isTransition & !insideUnion) println("Moved out of region");
}