I has implicit function and square region. I need to check this region for presence of part of curve, with interval arithmetic only.
My attempt:
ClearAll["Global`*"];
f[a_Interval, b_Interval] := Sin[a + b] - Cos[a*b] + 1;
s = 1.1;(*Square size*)
cx = -3.9; (*Square center x*)
cy = -1.2; (*Square center y*)
x = Interval[{cx - s/2, cx + s/2}];
y = Interval[{cy - s/2, cy + s/2}];
IntervalMemberQ[f[x, y], 0]
Does this code are correctly solve the problem?
Update:
I need to get a false
if the curve is guaranteed not in the specified square(include inner area). But true
value cannot guaranteed the opposite
f[a,b]==0
? And you want to determine whetherf[square1,square2]
hits zero? $\endgroup$False
is sufficient but not necessary condition for the square in question to contain no zero. Changings
to 2.0, for example, will give a result ofTrue
when in fact this larger square still contains no zero. $\endgroup$false
if the curve is guaranteed not in the specified square(include inner area). Buttrue
value cannot guaranteed the opposite. $\endgroup$False
is a guarantee of no intersection. So if that is all you require, the code is fine for that purpose. $\endgroup$