UtilDrawingGetSquareSimilarityPercentage(Size) Method

Determine the similarity percentage that the specified Size has with a square shape, by dividing its shortest side between the longest one.

For example, having a Size of 4x4 (Width x Height), this function will return a value of 1, meaning that all the sides ( {Top=4, Bottom=4, Left=4, Right=4} ) are of equal length, or in other words, it is a perfect square shape.

For example too, having a Size of 640x480 (Width x Height), this function will return a value of 0.75, meaning that the length of the sides ( {Top=640, Bottom=640, Left=480, Right=480} ) are 75% near to be a perfect square shape.

Definition

Namespace: DevCase.Core.Media.Graphics
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static double GetSquareSimilarityPercentage(
	Size size
)

Parameters

size  Size
The source Size.

Return Value

Double
The resulting similarity, expressed as a percentage value between 0 (as minimum) to 1.0 (as maximum).

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also