Table of Contents

Class MathExtensions

Namespace
Icy.Data
Assembly
IcyUI.dll

Provides utility extensions for the mathematical objects such as vectors, quaternions etc.

public static class MathExtensions
Inheritance
MathExtensions
Inherited Members

Methods

AsPoint(Size)

Gets the point representation of the specified Size instance.

public static Point AsPoint(this Size size)

Parameters

size Size

An instance of the Size to convert.

Returns

Point

Point representation of the specified size.

AsPoint(SizeF)

Gets the point representation of the specified SizeF instance.

public static PointF AsPoint(this SizeF size)

Parameters

size SizeF

An instance of the SizeF to convert.

Returns

PointF

Point representation of the specified size.

AsVector(Size)

Gets the vector representation of the specified Size instance.

public static Vector2 AsVector(this Size size)

Parameters

size Size

An instance of the Size to convert.

Returns

Vector2

Vector representation of the specified size.

AsVector(SizeF)

Gets the vector representation of the specified SizeF instance.

public static Vector2 AsVector(this SizeF size)

Parameters

size SizeF

An instance of the SizeF to convert.

Returns

Vector2

Vector representation of the specified size.

Center(Rectangle)

Gets the location of the middle point of the specified rectangle.

public static Point Center(this Rectangle rect)

Parameters

rect Rectangle

An instance of the Rectangle to get the middle point for.

Returns

Point

An instance of the Point with the middle location for the specified rectangle.

Remarks

If the middle point is not placed on an integer coordinate, it will be rounded with default rounding rules.

Max(Size, Size)

Gets the smallest size that contains both sizes: the larger width and the larger height.

public static Size Max(this Size left, Size right)

Parameters

left Size

The first size.

right Size

The second size.

Returns

Size

A size whose width and height are each the larger of the two.

ToYawPitchRoll(Quaternion)

Gets the yaw-pitch-roll Vector3 from the given Quaternion.

public static Vector3 ToYawPitchRoll(this Quaternion q)

Parameters

q Quaternion

A Quaternion to get Euler angles for.

Returns

Vector3

One of the possible rotation Euler angles in radians for the specified quaternion.