Math |
The MathRoutines type exposes the following members.
Name | Description | |
---|---|---|
MathRoutines | Initializes a new instance of the MathRoutines class |
Name | Description | |
---|---|---|
AngleDegInFirstFullCircle |
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. | |
AngleDiffDeg |
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. | |
AngleDiffRad |
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. | |
AngleRadInFirstFullCircle |
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. | |
CalcAngleOfLineVectorDouble | Calculates angle of line going from pointFrom to pointTo | |
CalcAngleOfLineVectorFloat | Calculates angle of line going from pointFrom to pointTo | |
CalcTwoLinesIntersection(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 | |
CalcTwoLinesIntersection(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 | |
DegreesAsRadians | Convert degrees to radians. | |
DistanceOfPoints | Calculates distance between two points. | |
Gaussian | Gaussian function | |
GradsAsRadians | Convert gradians to radians. | |
Hypotrochoid | Hyptrochoid | |
LinearFitSolveFactors | 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 | |
LinearRegression | Calculate linear line fit for given points | |
LineIntersection(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/ | |
LineIntersection(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/ | |
MysteryCurve | Mystery curve | |
PointDistanceFromLine(PointFloat, PointFloat, PointFloat) | Calculates distance from line to point. | |
PointDistanceFromLine(PointFloat, PointFloat, PointFloat, PointFloat, Single) | Calculates distance from line to point. | |
PointDistanceFromLineSegment | Calculates distance from line segment to point. | |
PointInsidePolygon | 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. | |
PolynomialRegression(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. | |
PolynomialRegression(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. | |
RadiansAsDegrees | Convert radians to degrees. | |
RadiansAsDegreesString | Make radians as degrees string. | |
RadiansAsGrads | Convert radians to gradians. | |
RadiansAsGradsString | Make radians as gradians string. | |
RadiansAsString | Make radians as string. | |
RelativeDistanceOfPoints | Calculates relative distance between two points. | |
ReplaceNaNs(Double, Double) | Replace NaN numbers with given value | |
ReplaceNaNs(Single, Single) | Replace NaN numbers with given value | |
Rotate | Rotate point. | |
RoundToInt(Double) | Convert double value to nearest integer. The fast way. | |
RoundToInt(Single) | Convert float value to nearest integer. The fast way. | |
StandardDeviation | Calculate standard deviation of values |