Table of Contents

Method GetContainmentRatio

Namespace
LMKit.Graphics.Geometry
Assembly
LM-Kit.NET.dll

GetContainmentRatio(IBounds, bool)

Computes the containment ratio between this rectangle and another bounds object.

public double GetContainmentRatio(IBounds other, bool relativeToOther = false)

Parameters

other IBounds

The other bounds to compare with.

relativeToOther bool

If false (default), the ratio is relative to the smaller of the two rectangles. If true, the ratio is relative to other, 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 other is null.