Method GetContainmentRatio
GetContainmentRatio(IBounds, bool)
Computes the containment ratio between this rectangle and another bounds object.
public double GetContainmentRatio(IBounds other, bool relativeToOther = false)
Parameters
otherIBoundsThe other bounds to compare with.
relativeToOtherboolIf
false(default), the ratio is relative to the smaller of the two rectangles. Iftrue, the ratio is relative toother, indicating what portion of it is inside this rectangle.
Returns
- double
A value in the range [0, 1], where 0 means no overlap and 1 means full containment.
Exceptions
- ArgumentNullException
Thrown when
otherisnull.