mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use clamp/clamp_range instead of min(max(..., upper), lower)
This commit is contained in:
@ -114,7 +114,7 @@ namespace vectorTools
|
||||
scalar cosPhi = (a & b)/(mag(a)*mag(b) + tolerance);
|
||||
|
||||
// Enforce bounding between -1 and 1
|
||||
return min(max(cosPhi, -1), 1);
|
||||
return clamp(cosPhi, -1, 1);
|
||||
}
|
||||
|
||||
//- Calculate angle between a and b in radians
|
||||
@ -129,7 +129,7 @@ namespace vectorTools
|
||||
scalar cosPhi = (a & b)/(mag(a)*mag(b) + tolerance);
|
||||
|
||||
// Enforce bounding between -1 and 1
|
||||
return acos( min(max(cosPhi, -1), 1) );
|
||||
return acos(clamp(cosPhi, -1, 1));
|
||||
}
|
||||
|
||||
//- Calculate angle between a and b in degrees
|
||||
|
||||
Reference in New Issue
Block a user