What does double.MaxValue and double.MinValue mean in the following context:
double minX, minY, maxX, maxY;
minX = double.MaxValue;
minY = double.MaxValue;
maxX = double.MinValue;
maxY = double.MinValue;
for(int i = 0 ; i < HPts.BranchCount; i++){
foreach(Point3d pt in HPts.Branch(i)){
if(minX > pt.X){
minX = pt.X;
}
if(minY > pt.Y){
minY = pt.Y;
}
if(maxX < pt.X){
maxX = pt.X;
}
if(maxY < pt.Y){
maxY = pt.Y;
}
They are the maximum and minimum values you can store in a double.
This is used to determine the min/max X and Y locations. For example, by starting with minX set to the maximum allowable value for a double, the first time through the loop, minX > pt.X will be true, which will cause minX to set to the first X value. Eventually, the minimum value for X will be stored there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With