Class SizeMathExtensions
- Namespace
- Splat
- Assembly
- Splat.dll
Provides extension methods for performing mathematical operations on SizeF instances.
public static class SizeMathExtensions
- Inheritance
-
SizeMathExtensions
Remarks
These methods enable common size-related calculations, such as scaling and approximate equality checks, to be performed directly on SizeF objects. All methods are static and can be used as extension methods for improved readability and convenience.
Methods
ScaledBy(SizeF, float)
Returns a new SizeF whose width and height are multiplied by the specified scaling factor.
public static SizeF ScaledBy(this SizeF value, float factor)
Parameters
valueSizeFThe original SizeF to scale.
factorfloatThe factor by which to scale the width and height of the size.
Returns
- SizeF
A new SizeF whose dimensions are the original width and height multiplied by the specified factor.
WithinEpsilonOf(SizeF, SizeF, float)
Determines whether the current size is within a specified distance (epsilon) of another size.
public static bool WithinEpsilonOf(this SizeF value, SizeF other, float epsilon)
Parameters
valueSizeFThe size to compare from.
otherSizeFThe size to compare to.
epsilonfloatThe maximum allowed distance between the two sizes. Must be non-negative.
Returns
- bool
true if the Euclidean distance between the two sizes is less than epsilon; otherwise, false.