New to Telerik UI for WinFormsStart a free 30-day trial

RadMath

Class

Provides static mathematical functions and constants.

Definition

Namespace:Telerik.Charting

Assembly:Telerik.WinControls.dll

Syntax:

C#
public static class RadMath

Inheritance: objectRadMath

Fields

The factor used to convert degrees to their radians equivalent.

C#
public const double DegToRadFactor = 0.017453292519943295

Smallest unit such that 1.0+DBL_EPSILON != 1.0.

C#
public const double Epsilon = 2.220446049250313E-09

The factor used to convert radians to their degree equivalent.

C#
public const double RadToDegFactor = 57.29577951308232

Methods

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

C#
public static bool AreClose(double value1, double value2, double tolerance)
Parameters:value1double

The first value to compare.

value2double

The second value to compare.

tolerancedouble

The tolerance value for comparison.

Returns:

bool

True if the values are close within the tolerance; otherwise, false.

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

C#
public static bool AreClose(double value1, double value2)
Parameters:value1double

The first value to compare.

value2double

The second value to compare.

Returns:

bool

True if the values are close; otherwise, false.

C#
public static double CalculateHorizontalLineIntersectionPoint(double x1, double y1, double x2, double y2, double horizontalLineY)
Parameters:x1doubley1doublex2doubley2doublehorizontalLineYdoubleReturns:

double

C#
public static double CalculateVerticalLineIntersectionPoint(double x1, double y1, double x2, double y2, double verticalLineX)
Parameters:x1doubley1doublex2doubley2doubleverticalLineXdoubleReturns:

double

C#
public static double Coerce(double value, double min, double max)
Parameters:valuedoublemindoublemaxdoubleReturns:

double

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

C#
public static RadPoint GetArcPoint(double angle, RadPoint center, double radius)
Parameters:angledoublecenterRadPointradiusdoubleReturns:

RadPoint

Gets the distance between two points in a plane.

C#
public static double GetPointDistance(double x1, double x2, double y1, double y2)
Parameters:x1double

The x-coordinate of the first point.

x2double

The x-coordinate of the second point.

y1double

The y-coordinate of the first point.

y2double

The y-coordinate of the second point.

Returns:

double

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

C#
public static bool IsOne(decimal value)
Parameters:valuedecimal

The decimal value to check.

Returns:

bool

True if the value is close to one; otherwise, false.

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

C#
public static bool IsOne(double value)
Parameters:valuedouble

The value to check.

Returns:

bool

True if the value is close to one; otherwise, false.

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

C#
public static bool IsZero(decimal value)
Parameters:valuedecimal

The decimal value to check.

Returns:

bool

True if the value is close to zero; otherwise, false.

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

C#
public static bool IsZero(double value)
Parameters:valuedouble

The value to check.

Returns:

bool

True if the value is close to zero; otherwise, false.

C#
public static void TrimLineSegmentToArea(ref RadPoint point1, ref RadPoint point2, RadRect plotAreaClip)
Parameters:point1RadPointpoint2RadPointplotAreaClipRadRect