Table of Contents

Class MathSupport

Namespace
Wyrowski.Infrastructure.Support
Assembly
Wyrowski.Infrastructure.dll

\stable This class contains various mathematical functions and constants.

public static class MathSupport
Inheritance
MathSupport
Inherited Members

Fields

Epsilon

Declaration of an epsilon to check whether two values (influenced by numerical errors) are equal. In other words, two values \(a\) and \(b\) are considered as identical if \(b \cdot (1 - \epsilon) \geq a \geq b \cdot (1 + \epsilon)\).

public const double Epsilon = 1E-10

Field Value

double

OneDegree

One degree (1°) in radians. Can be used for easy conversion between degrees and radians.

public const double OneDegree = 0.017453292519943295

Field Value

double

Methods

Pow(double, double)

Raises the double number to the given power.

public static double Pow(double baseNumber, double exponent)

Parameters

baseNumber double

The base.

exponent double

The exponent.

Returns

double

The double number to the power of the exponent.

RoundToInt(double)

This function rounds to closest integer. The difference to Math.Round is that n + 0.5 is always rounded to n + 1.

public static int RoundToInt(double valueToRound)

Parameters

valueToRound double

Value to be rounded.

Returns

int

Result of operation.