Click or drag to resize

MathRoutines Class

LightningChart .NET Help
Chart tools provides versatile static methods
Inheritance Hierarchy
SystemObject
  LightningChartLib.UWP.ChartingMVVMMathRoutines

Namespace: LightningChartLib.UWP.ChartingMVVM
Assembly: LightningChart.UWP.ChartingMVVM (in LightningChart.UWP.ChartingMVVM.dll) Version: 11.0.1
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class MathRoutines

The MathRoutines type exposes the following members.

Constructors
 NameDescription
Public methodMathRoutinesInitializes a new instance of the MathRoutines class
Top
Methods
 NameDescription
Public methodStatic memberAngleDegInFirstFullCircle Retrieve the input angle value as positive angle of the first full rotation in degrees.

Note that the range contains 0, but not the "full angle" of 360 degrees.

Public methodStatic memberAngleDiffDeg Solve smallest absolute difference between two angles in degrees. This takes in account the periodic nature of the values, meaning that full circles do not affect the difference.

Useful in comparing the difference of angles, e.g. on testing if angles are the same.

Note that the type of angle unit affects the result. Use AngleDiffRad(Double, Double) for radians.

Public methodStatic memberAngleDiffRad Solve smallest absolute difference between two angles in radians. This takes in account the periodic nature of the values, meaning that full circles do not affect the difference.

Useful in comparing the difference of angles, e.g. on testing if angles are the same.

Note that the type of angle unit affects the result. Use AngleDiffDeg(Double, Double) for degrees and examples.

Public methodStatic memberAngleRadInFirstFullCircle Retrieve the input angle value as positive angle of the first full rotation in radians.

Note that the range contains 0, but not the "full angle" of PI radians.

Public methodStatic memberCalcAngleOfLineVectorDouble Calculates angle of line going from pointFrom to pointTo
Public methodStatic memberCalcAngleOfLineVectorFloat Calculates angle of line going from pointFrom to pointTo
Public methodStatic memberCalcTwoLinesIntersection(PointDouble2D, PointDouble2D, PointDouble2D, PointDouble2D, PointDouble2D) Calculates intersection point of two lines. Line 1: goes through A1 and A2 Line 2: goes through B1 and B2
Public methodStatic memberCalcTwoLinesIntersection(PointFloat, PointFloat, PointFloat, PointFloat, PointFloat) Calculates intersection point of two lines. Line 1: goes through A1 and A2 Line 2: goes through B1 and B2
Public methodStatic memberDegreesAsRadians Convert degrees to radians.
Public methodStatic memberDistanceOfPoints Calculates distance between two points.
Public methodStatic memberGaussian Gaussian function
Public methodStatic memberGradsAsRadians Convert gradians to radians.
Public methodStatic memberHypotrochoid Hyptrochoid
Public methodStatic memberLinearFitSolveFactors Calculate linear fit from given points. Makes best fit with Least Square regression method. A line equation is y = k*x + b, that is, y = gradient * x + coefficient
Public methodStatic memberLinearRegression Calculate linear line fit for given points
Public methodStatic memberLineIntersection(PointDouble2D, PointDouble2D, PointDouble2D, PointDouble2D, PointDouble2D) Calculates intersection point of two lines. Line 1: goes through A1 and A2. Line 2: goes through B1 and B2. Algorithm copied from http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
Public methodStatic memberLineIntersection(PointFloat, PointFloat, PointFloat, PointFloat, PointFloat) Calculates intersection point of two lines. Line 1: goes through A1 and A2. Line 2: goes through B1 and B2. Algorithm copied from http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
Public methodStatic memberMysteryCurve Mystery curve
Public methodStatic memberPointDistanceFromLine(PointFloat, PointFloat, PointFloat) Calculates distance from line to point.
Public methodStatic memberPointDistanceFromLine(PointFloat, PointFloat, PointFloat, PointFloat, Single) Calculates distance from line to point.
Public methodStatic memberPointDistanceFromLineSegment Calculates distance from line segment to point.
Public methodStatic memberPointInsidePolygon Check whether point is inside polygon. Algorithm from: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html Copyright (c) 1970-2003, Wm. Randolph Franklin. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. 2. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution. 3. The name of W. Randolph Franklin may not be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Public methodStatic memberPolynomialRegression(Double, Double, Double, Int32) Calculate polymial line fit. Calculates polynomial factors, and uses these factors to solve Y values based on given X value array.
Public methodStatic memberPolynomialRegression(Double, Double, Double, Int32, Double) Calculate polymial line fit. Calculates polynomial factors, and uses these factors to solve Y values based on given X value array.
Public methodStatic memberRadiansAsDegrees Convert radians to degrees.
Public methodStatic memberRadiansAsDegreesString Make radians as degrees string.
Public methodStatic memberRadiansAsGrads Convert radians to gradians.
Public methodStatic memberRadiansAsGradsString Make radians as gradians string.
Public methodStatic memberRadiansAsString Make radians as string.
Public methodStatic memberRelativeDistanceOfPoints Calculates relative distance between two points.
Public methodStatic memberReplaceNaNs(Double, Double) Replace NaN numbers with given value
Public methodStatic memberReplaceNaNs(Single, Single) Replace NaN numbers with given value
Public methodStatic memberRotate Rotate point.
Public methodStatic memberRoundToInt(Double) Convert double value to nearest integer. The fast way.
Public methodStatic memberRoundToInt(Single) Convert float value to nearest integer. The fast way.
Public methodStatic memberStandardDeviation Calculate standard deviation of values
Top
See Also