Class ChartMath
Provides constants and static methods for mathematical functions.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Chart
Assembly: Syncfusion.Chart.Base.dll
Syntax
public static class ChartMath
Fields
DblPI
A double PI.
Declaration
public const double DblPI = 6.2831853071795862
Field Value
Type |
---|
System.Double |
Epsilon
A the minimal value of System.Double (magical number).
Declaration
public const double Epsilon = 1E-05
Field Value
Type |
---|
System.Double |
HlfPI
A half of PI.
Declaration
public const double HlfPI = 1.5707963267948966
Field Value
Type |
---|
System.Double |
ToDegrees
A ratio of degrees to radials.
Declaration
public const double ToDegrees = 57.295779513082323
Field Value
Type |
---|
System.Double |
ToRadians
A ratio of radials to degrees.
Declaration
public const double ToRadians = 0.017453292519943295
Field Value
Type |
---|
System.Double |
Methods
AddPoint(PointF, Size)
Translates a given System.Drawing.PointF by a specified System.Drawing.Size.
Declaration
public static PointF AddPoint(PointF pt, Size sz)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | pt | The point. |
System.Drawing.Size | sz | The size. |
Returns
Type |
---|
System.Drawing.PointF |
AddPoint(PointF, SizeF)
Translates a given System.Drawing.PointF by a specified System.Drawing.SizeF.
Declaration
public static PointF AddPoint(PointF pt, SizeF sz)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | pt | The point. |
System.Drawing.SizeF | sz | The size. |
Returns
Type |
---|
System.Drawing.PointF |
Bisection(ChartMath.DoubleFunc, Double, Double, Double, Int32)
Computes the bisections by the specified function.
Declaration
public static double Bisection(ChartMath.DoubleFunc fnc, double x1, double x2, double xAccuracy, int maxIterationCount)
Parameters
Type | Name | Description |
---|---|---|
ChartMath.DoubleFunc | fnc | The function handler. |
System.Double | x1 | The x1. |
System.Double | x2 | The x2. |
System.Double | xAccuracy | The x accuracy. |
System.Int32 | maxIterationCount | The max iteration count. |
Returns
Type |
---|
System.Double |
CenterRotatedRectangleBounds(RectangleF, Double)
Compute the bounds of center rotated rectangle.
Declaration
public static RectangleF CenterRotatedRectangleBounds(RectangleF r, double angle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | r | The rectangle. |
System.Double | angle | The rotation angle. |
Returns
Type |
---|
System.Drawing.RectangleF |
CorrectRect(RectangleF)
Corrects the size of the specified rectangle.
Declaration
public static RectangleF CorrectRect(RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect | The rect. |
Returns
Type |
---|
System.Drawing.RectangleF |
CorrectRect(Single, Single, Single, Single)
Creates the System.Drawing.RectangleF by the specified points and corrects the size.
Declaration
public static RectangleF CorrectRect(float x1, float y1, float x2, float y2)
Parameters
Type | Name | Description |
---|---|---|
System.Single | x1 | The x1. |
System.Single | y1 | The y1. |
System.Single | x2 | The x2. |
System.Single | y2 | The y2. |
Returns
Type |
---|
System.Drawing.RectangleF |
Determinant(PointF, PointF)
Computes the determinant by the specified matrix.
Declaration
public static float Determinant(PointF p1, PointF p2)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | p1 | The first row of matrix. |
System.Drawing.PointF | p2 | The second row of matrix. |
Returns
Type |
---|
System.Single |
DistanceBetweenPoints(PointF, PointF)
Calculates distance between two points.
Declaration
public static float DistanceBetweenPoints(PointF p1, PointF p2)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | p1 | The point to calculate distance from. |
System.Drawing.PointF | p2 | The point to calculate distance to. |
Returns
Type | Description |
---|---|
System.Single | Distance between to point. |
GetCenter(RectangleF)
Returns the center of specified rectangle.
Declaration
public static PointF GetCenter(RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect | The rect. |
Returns
Type |
---|
System.Drawing.PointF |
GetNormal(Vector3D, Vector3D, Vector3D)
Gets the normal.
Declaration
public static Vector3D GetNormal(Vector3D v1, Vector3D v2, Vector3D v3)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | v1 | The start point of plane. |
Vector3D | v2 | The v2. |
Vector3D | v3 | The v3. |
Returns
Type |
---|
Vector3D |
GetPointByAngle(RectangleF, Double, Boolean)
Gets the point by angle.
Declaration
public static PointF GetPointByAngle(RectangleF rect, double angle, bool isCircle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect | The rect. |
System.Double | angle | The angle. |
System.Boolean | isCircle | if set to |
Returns
Type |
---|
System.Drawing.PointF |
GetRadius(RectangleF)
Returns the half size of rectangle.
Declaration
public static SizeF GetRadius(RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect |
Returns
Type |
---|
System.Drawing.SizeF |
GetRectByCenter(PointF, SizeF)
Creates the System.Drawing.RectangleF by specified center and radius.
Declaration
public static RectangleF GetRectByCenter(PointF center, SizeF radius)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | center | The center. |
System.Drawing.SizeF | radius | The radius. |
Returns
Type |
---|
System.Drawing.RectangleF |
GetTwoClosestPoints(Double[], Double, out Int32, out Int32)
Gets the indices of two closest points by the specified value.
Declaration
public static void GetTwoClosestPoints(double[] xs, double point, out int index1, out int index2)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | xs | The array of double. |
System.Double | point | The specified value. |
System.Int32 | index1 | The index of first point. |
System.Int32 | index2 | The index of second point. |
LeftCenterRotatedRectangleBounds(RectangleF, Double)
Compute the bounds of left-center rotated rectangle.
Declaration
public static RectangleF LeftCenterRotatedRectangleBounds(RectangleF r, double angle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | r | The rectangle. |
System.Double | angle | The rotation angle. |
Returns
Type |
---|
System.Drawing.RectangleF |
LineSegmentIntersectionPoint(PointF, PointF, PointF, PointF)
Computes the point of lines intersection.
Declaration
public static PointF LineSegmentIntersectionPoint(PointF a, PointF b, PointF c, PointF d)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | a | The start point of first line. |
System.Drawing.PointF | b | The end point of first line. |
System.Drawing.PointF | c | The start point of second line. |
System.Drawing.PointF | d | The end point of second line. |
Returns
Type |
---|
System.Drawing.PointF |
Max(Double[])
Returns the maximal value from array.
Declaration
public static double Max(double[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | values | The array of values. |
Returns
Type | Description |
---|---|
System.Double | The maximal value. |
Min(Double[])
Returns the minimal value from array.
Declaration
public static double Min(double[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | values | The array of values. |
Returns
Type | Description |
---|---|
System.Double | The minimal value. |
MinMax(Double, Double, Double)
Checks whether specified value is inside of specified range.
Declaration
public static double MinMax(double value, double min, double max)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value. |
System.Double | min | The minimal value. |
System.Double | max | The maximal value. |
Returns
Type |
---|
System.Double |
MinMax(Double, Double, out Double, out Double)
Mins the max.
Declaration
public static void MinMax(double value1, double value2, out double min, out double max)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The value1. |
System.Double | value2 | The value2. |
System.Double | min | The min. |
System.Double | max | The max. |
MinMax(Int32, Int32, Int32)
Checks whether specified value is inside of specified range.
Declaration
public static int MinMax(int value, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
System.Int32 | min | The minimal value. |
System.Int32 | max | The maximal value. |
Returns
Type |
---|
System.Int32 |
MinMax(Single, Single, Single)
Checks whether specified value is inside of specified range.
Declaration
public static float MinMax(float value, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The value. |
System.Single | min | The minimal value. |
System.Single | max | The maximal value. |
Returns
Type |
---|
System.Single |
RectangleIntersectsWithLine(RectangleF, PointF, PointF)
Indicates whether specified rectangle is intersects with the line.
Declaration
public static bool RectangleIntersectsWithLine(RectangleF r, PointF a, PointF b)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | r | The rectangle. |
System.Drawing.PointF | a | The start of line. |
System.Drawing.PointF | b | The end of line. |
Returns
Type |
---|
System.Boolean |
RectanlgeIntersectsWithLine(RectangleF, PointF, PointF)
Indicates whether specified rectangle is intersects with the line.
Declaration
[Obsolete("Use RectangleIntersectsWithLine")]
public static bool RectanlgeIntersectsWithLine(RectangleF r, PointF a, PointF b)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | r | The rectangle. |
System.Drawing.PointF | a | The start of line. |
System.Drawing.PointF | b | The end of line. |
Returns
Type |
---|
System.Boolean |
RotatedRectangleBounds(RectangleF, Double)
Compute the bounds of rotated rectangle.
Declaration
public static RectangleF RotatedRectangleBounds(RectangleF r, double angle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | r | The rectangle. |
System.Double | angle | The rotation angle. |
Returns
Type |
---|
System.Drawing.RectangleF |
Round(Double, Double)
Rounds the specified value.
Declaration
public static double Round(double value, double div)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to round. |
System.Double | div | The div. |
Returns
Type |
---|
System.Double |
Round(Double, Double, Boolean)
Rounds the specified value.
Declaration
public static double Round(double value, double div, bool up)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value. |
System.Double | div | The div. |
System.Boolean | up | if set to |
Returns
Type |
---|
System.Double |
SmartBisection(ChartMath.DoubleFunc, Double, Double, Double, Int32, Int32)
Computes the bisections by the specified function.
Declaration
public static double SmartBisection(ChartMath.DoubleFunc fnc, double x1, double x2, double xAccuracy, int maxIterationCount, int tabulCount)
Parameters
Type | Name | Description |
---|---|---|
ChartMath.DoubleFunc | fnc | The function handler. |
System.Double | x1 | The x1. |
System.Double | x2 | The x2. |
System.Double | xAccuracy | The x accuracy. |
System.Int32 | maxIterationCount | The max iteration count. |
System.Int32 | tabulCount | The table count. |
Returns
Type |
---|
System.Double |