using System;
namespace Science.Mathematics.VectorCalculus
{
///
/// Domain in Two Dimensional Space
///
public class Domain2D
{
private double xf, xt, yf, yt;
public Domain2D()
{
}
private Function.ToLastType cf2;
public Function.ToLastType ConditionFunctionsLessThanZero
{
set{cf2 = value;}
}
public double LowerBoundOfX
{
get{return xf;}
set{xf=value;}
}
public double UpperBoundOfX
{
get{return xt;}
set{xt=value;}
}
public double LowerBoundOfY
{
get{return yf;}
set{yf=value;}
}
public double UpperBoundOfY
{
get{return yt;}
set{yt=value;}
}
private bool doneQ = false;
private int n = 0;
public bool Check(double x, double y)
{
if (doneQ)
{
for (int k = 0; k < n; k++)
if (cf2(x, y)[k] >= 0.0) return false;
return true;
}
else
{
n = cf2(x, y).Length;
doneQ = true;
for (int k = 0; k < n; k++)
if (cf2(x, y)[k] >= 0.0) return false;
return true;
}
}
}
}