Class
RadMath

Provides static mathematical functions and constants.

Definition

Namespace:Telerik.Charting

Assembly:Telerik.Windows.Controls.Chart.dll

Syntax:

cs-api-definition
public static class RadMath

Inheritance: objectRadMath

Fields

DegToRadFactor

The factor used to convert degrees to their radians equivalent.

Declaration

cs-api-definition
public const double DegToRadFactor = 0.017453292519943295

Field Value

double

Epsilon

Smallest unit such that 1.0+DBL_EPSILON != 1.0.

Declaration

cs-api-definition
public const double Epsilon = 2.220446049250313E-09

Field Value

double

RadToDegFactor

The factor used to convert radians to their degree equivalent.

Declaration

cs-api-definition
public const double RadToDegFactor = 57.29577951308232

Field Value

double

Methods

AreClose(double, double)

Determines whether the two specified values are close within the order of EPSILON.

Declaration

cs-api-definition
public static bool AreClose(double value1, double value2)

Parameters

value1

double

The first value.

value2

double

The second value.

Returns

bool

AreClose(double, double, double)

Determines whether the two specified values are close within the order of tolerance.

Declaration

cs-api-definition
public static bool AreClose(double value1, double value2, double tolerance)

Parameters

value1

double

The first value.

value2

double

The second value.

tolerance

double

The allowed tolerance.

Returns

bool

GetArcPoint(double, RadPoint, double)

Gets the point that lies on the arc segment of the ellipse, described by the center and radius parameters.

Declaration

cs-api-definition
public static RadPoint GetArcPoint(double angle, RadPoint center, double radius)

Parameters

angle

double

The arc segment angle.

center

RadPoint

The center of the ellipse.

radius

double

The radius.

Returns

RadPoint

GetPointDistance(double, double, double, double)

Gets the distance between two points in a plane.

Declaration

cs-api-definition
public static double GetPointDistance(double x1, double x2, double y1, double y2)

Parameters

x1

double

The x-coordinate of the first point.

x2

double

The x-coordinate of the second point.

y1

double

The y-coordinate of the first point.

y2

double

The y-coordinate of the second point.

Returns

double

GetPolarCoordinates(RadPoint, RadPoint, out double, out double)

Gets the polar coordinates (radius and angle) from the given arcPoint.

Declaration

cs-api-definition
public static void GetPolarCoordinates(RadPoint arcPoint, RadPoint center, out double radius, out double angle)

Parameters

arcPoint

RadPoint

The point in cartesian coordinates.

center

RadPoint

The center.

radius

double

The distance from the center.

angle

double

The angle in degrees.

Remarks

This is the reverse operation of GetArcPoint(double, RadPoint, double).

GetStandardDeviation(IEnumerable<double>)

Gets the standard deviation of a set of numbers.

Declaration

cs-api-definition
public static double GetStandardDeviation(IEnumerable<double> values)

Parameters

values

IEnumerable<double>

Returns

double

IsOne(decimal)

Determines whether the specified value is close to 1 within the order of EPSILON.

Declaration

cs-api-definition
public static bool IsOne(decimal value)

Parameters

value

decimal

The value.

Returns

bool

IsOne(double)

Determines whether the specified value is close to 1 within the order of EPSILON.

Declaration

cs-api-definition
public static bool IsOne(double value)

Parameters

value

double

The value.

Returns

bool

IsZero(decimal)

Determines whether the specified value is close to 0 within the order of EPSILON.

Declaration

cs-api-definition
public static bool IsZero(decimal value)

Parameters

value

decimal

The value.

Returns

bool

IsZero(double)

Determines whether the specified value is close to 0 within the order of EPSILON.

Declaration

cs-api-definition
public static bool IsZero(double value)

Parameters

value

double

The value.

Returns

bool