Fields
Cross
#Gets the 'multiplication sign' x-like character oftentimes used in mathematical notation to denote multiplication.
Dot
#Gets the 'middle dot' character oftentimes used in mathematical notation to denote multiplication.
DoublePrecisionMaximumIntegerAccuracy
#The last value at which the double precision floating point epsilon assumes a value of 1.0. That is, the distance between this float and the first bigger one is > 1.0
DoublePrecisionMinimumIntegerAccuracy
#The first value at which the double precision floating point epsilon assumes a value of 1.0. That is, the distance between this float and first bigger one is exactly 1.0
Huge
#Numbers larger than this are considered huge and will almost certainly result in problems when used in calculations or display.
Large
#Numbers larger than this but smaller than Huge are considered large. Although not necessarily a problem, users may be warned about them as they indicate a potential problem.
MaximumSafeArrayLength
#Defines the maximum size of an array that Grasshopper is happy to create. This is hard-coded to 1-billion, or roughly half the maximum 32-bit integer maximum value. This constant was chosen to be high enough for any sensible computation, yet small enough so that two maximum sized arrays can still be indexed as a single big one.
OneMinusSmallSquared
#The squared cosine of a small angle, using the small angle approximation. This number is useful for comparing angles to a small angle when the angle is given by its cosine, for example as some scalar product. For example, to test whether a non-zero vector n has smaller angle to the z axis than Small radians, one can test for n.Z * n.Z >= OneMinusSmallSquared * n.SquareLength. This is efficient because it does not require a square root or trigonometric function.
Small
#Numbers smaller than this but larger than Tiny are considered small. Although not necessarily a problem, users may be warned about them as they indicate a potential problem.
Tiny
#Numbers smaller than this are considered tiny and are either assumed to be a rounding error away from zero, or a faulty value.
Properties
HighestPrime
#Gets the highest cached prime, obviously not the highest *actual* prime, I'm keeping that one a secret.
Methods
Acos
#Compute the arc cosine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc cosine of angle.
Acos
#Compute the arc cosine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc cosine of angle.
Acosh
#Compute the hyperbolic arc cosine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc cosine of angle.
Acosh
#Compute the hyperbolic arc cosine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc cosine of angle.
Acot
#Compute the arc cotangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc cotangent of angle.
Acot
#Compute the arc cotangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc cotangent of angle.
Acoth
#Compute the hyperbolic arc cotangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc cotangent of angle.
Acoth
#Compute the hyperbolic arc cotangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc cotangent of angle.
Acsc
#Compute the arc secant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc secant of angle.
Acsc
#Compute the arc secant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc secant of angle.
Acsch
#Compute the hyperbolic arc cosecant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc cosecant of angle.
Acsch
#Compute the hyperbolic arc cosecant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc cosecant of angle.
AGM
#Compute the Arithmetic-Geometric mean of two numbers.
Airy
#Compute the appropriate Airy function for the given argument.
Parameters:
| function (Maths.AiryKind) | Function to evaluate. |
| z (Complex) | Real argument. |
Returns: Result of Airy function.
Airy
#Compute the appropriate Airy function for the given argument.
Parameters:
| function (Maths.AiryKind) | Function to evaluate. |
| z (double) | Real argument. |
Returns: Result of Airy function.
AM
#Compute the Arithmetic mean of two numbers.
AM
#Compute the Arithmetic mean of two numbers.
AM
#Compute the Arithmetic mean of two points.
AM
#Compute the Arithmetic mean of two vectors.
ApproximateMaassWaveform
#AreAllInfinite
#Test whether all values are infinite values.
Parameters:
| values (params double[]) | Value to check. |
Returns: True if all values are nan.
AreAllNaN
#Test whether all values are NaN values.
Parameters:
| values (params double[]) | Value to check. |
Returns: True if all values are nan.
Asec
#Compute the arc secant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc secant of angle.
Asec
#Compute the arc secant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc secant of angle.
Asech
#Compute the hyperbolic arc secant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc secant of angle.
Asech
#Compute the hyperbolic arc secant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc secant of angle.
Asin
#Compute the arc sine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc sine of angle.
Asin
#Compute the arc sine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc sine of angle.
Asinh
#Compute the hyperbolic arc sine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc sine of angle.
Asinh
#Compute the hyperbolic arc sine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc sine of angle.
Atan
#Compute the arc tangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Arc tangent of angle.
Atan
#Compute the arc tangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Arc tangent of angle.
Atanh
#Compute the hyperbolic arc tangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic arc tangent of angle.
Atanh
#Compute the hyperbolic arc tangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic arc tangent of angle.
Bessel
#Compute the appropriate Bessel function for the given argument.
Parameters:
| function (Maths.BesselKind) | Bessel function. |
| x (double) | Argument. |
Returns: Result of the Bessel function.
BesselFirstKindIntegral
#An approximate implementation of a Bessel function of the first kind using the Bessel integral between zero and pi. This method does not suffer from numeric instability but it is an approximate solver.
BesselSecondKindIntegral
#An approximate implementation of a Bessel function of the second kind using the Bessel integral between zero and pi. This method does not suffer from numeric instability but it is an approximate solver.
Beta
#Computes the Euler Beta function.
BetaLn
#Computes the natural logarithm of the Euler Beta function.
Bifurcation
#Evaluate the standard Feigenbaum bifurcation diagram using the logistic map. Due to the strong iterative nature of this computation, the values inside the process are always rounded to 6 decimal places.
Binomial
#Compute the binomial coefficient using partial factorials (n choose k).
Parameters:
| n (double) | N parameter, must be non-negative. |
| k (double) | K parameter, must be non-negative. |
| token (CancellationToken) | Cancellation token. |
Returns: Binomial coefficient.
Binomial
#obsoleteUse the overload which takes a cancellation token.
Compute the binomial coefficient using partial factorials (n choose k).
Binomial
#Compute the binomial coefficient (n choose k).
BinomialCoefficient
#Compute the binomial coefficient of two integers.
Parameters:
| n (int) | |
| k (int) | |
| token (CancellationToken) |
BinomialCoefficient
#obsoleteUse the overload which takes a cancellation token.
Compute the binomial coefficient of two integers.
BinomialLn
#Compute the natural logarithm of binomial coefficient (n choose k).
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (Complex) | Value to round. |
Returns: Rounded value.
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (decimal) | Value to round. |
Returns: Rounded value.
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (double) | Value to round. |
Returns: Rounded value.
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (float) | Value to round. |
Returns: Rounded value.
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (Point3d) | Value to round. |
Returns: Rounded value.
Ceiling
#Default Grasshopper ceiling method.
Parameters:
| value (Vector3d) | Value to round. |
Returns: Rounded value.
CieDeltaE2000
#[EditorBrowsable(EditorBrowsableState.Never)]
public static double CieDeltaE2000(double lum1, double a1, double b1, double lum2, double a2, double b2)
Colour difference according to the CIE ΔE₀₀ standard.
This is a re-implementation of the gfiumara/CIEDE2000 C++ source at: https://github.com/gfiumara/CIEDE2000
Which in turn is based on the paper: http://www2.ece.rochester.edu/~gsharma/ciede2000/ciede2000noteCRNA.pdf
Clip
#Clip a value to two limits.
Parameters:
| value (BigInteger) | Value to clip. |
| min (BigInteger) | Inclusive lower limit. |
| max (BigInteger) | Inclusive upper limit. |
Returns: Clipped value.
Clip
#Clip a value to two limits.
Clip
#Clip a value to two limits.
Clip
#Clip a value to two limits.
Clip
#Clip a value to two limits.
Clip
#Clip a value to two limits.
Clip
#Clip a value to two limits.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
Clip
#Clip a set of values to a numeric domain.
ComputeOutlierMetrics
#Compute local outlier metrics for each value in a data set.
Correlation
#public static double Correlation(CorrelationMethod method, IEnumerable<double> a, IEnumerable<double> b)
Compute the Pearson product-moment correlation coefficient.
Parameters:
| method (Maths.CorrelationMethod) | Algorithm to use. |
| a (IEnumerable<double>) | First data set. |
| b (IEnumerable<double>) | Second data set. |
Returns: Correlation coefficient.
Minus one represents total negative correlation.
Zero represents no correlation whatsoever.
Plus one represents total positive correlation.
Cos
#Compute the cosine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Cosine of angle.
Cos
#Compute the cosine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Cosine of angle.
Cosh
#Compute the hyperbolic cosine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic cosine of angle.
Cosh
#Compute the hyperbolic cosine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic cosine of angle.
CosineRule
#Apply the Law of Cosines to a triangle.
Cot
#Compute the cotangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Cotangent of angle.
Cot
#Compute the cotangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Cotangent of angle.
Coth
#Compute the hyperbolic cotangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic cotangent of angle.
Coth
#Compute the hyperbolic cotangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic cotangent of angle.
Count<T>
#Count how many items pass the test.
CrossRatio
#Compute the cross ratio of four numbers.
CrossRatio
#Compute the cross ratio of four numbers. This only really makes sense if the points are collinear, but this constraint is not enforced.
Csc
#Compute the cosecant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Cosecant of angle.
Csc
#Compute the cosecant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Cosecant of angle.
Csch
#Compute the hyperbolic cosecant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic cosecant of angle.
Csch
#Compute the hyperbolic cosecant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic cosecant of angle.
CumulativeDensity
#Compute the cumulative density, or Gaussian integral of a value x.
Parameters:
| z (double) | Argument. |
Returns: Cumulative density up to z.
DetectOutliersGrubbs
#Find outliers using the Grubbs-test.
DetectOutliersModifiedZScore
#Find outliers using the modified Z-score test.
DetectOutliersPercentile
#Find percentile based outliers.
DetectOutliersTrim
#Find outliers by trimming a fixed number of items from both ends of the sorted collection.
DetectOutliersTukey
#Find outliers using the Tukey-test.
DetectOutliersZScore
#Find outliers using the Z-score test.
DiGamma
#Computes the DiGamma function for a real number. This is the defined as the derivative of the logarithm of the Gamma function.
Parameters:
| z (double) | Argument. |
Returns: DiGamma value.
DiGammaInverse
#Computes the inverse DiGamma function for a real number.
Parameters:
| p (double) | Argument. |
Returns: DiGamma value.
DigitalRoot
#Compute the digital root of a number. Negative numbers will retain negative roots. The digital root is the sum of all the digits in the number until only one digit remains.
Parameters:
| integer (BigInteger) | Integer to reduce. |
Returns: Digital root.
DigitalRoot
#Compute the digital root of a number. Negative numbers will retain negative roots. The digital root is the sum of all the digits in the number until only one digit remains.
Parameters:
| integer (int) | Integer to reduce. |
Returns: Digital root.
DigitalRoot
#Compute the digital root of a number. Negative numbers will retain negative roots. The digital root is the sum of all the digits in the number until only one digit remains.
Parameters:
| integer (long) | Integer to reduce. |
Returns: Digital root.
Distance
#Measure the distance between two colours using a specific metric.
Parameters:
| metric (Maths.ColourMetric) | Difference metric. |
| a (Color) | First colour. |
| b (Color) | Second colour. |
Returns: Measured difference.
Distance
#Measure the distance between two colours using a specific metric.
Parameters:
| metric (Maths.ColourMetric) | Difference metric. |
| a (Colour) | First colour. |
| b (Colour) | Second colour. |
Returns: Measured difference.
Distance
#Compute a custom distance metric between two positions.
Parameters:
| metric (Maths.DistanceMetric) | Distance metric to apply. |
| a (double[]) | First position. |
| b (double[]) | Second position. |
Returns: Distance between a and b.
Distance
#Compute a custom distance metric between two positions.
Parameters:
| metric (Maths.DistanceMetric) | Distance metric to apply. |
| a (Locus) | First position. |
| b (Locus) | Second position. |
Returns: Distance between a and b.
Distance
#Compute a custom distance metric between two positions.
Parameters:
| metric (Maths.DistanceMetric) | Distance metric to apply. |
| a (Point3d) | First position. |
| b (Point3d) | Second position. |
Returns: Distance between a and b.
DistanceToQuadrance
#Convert a distance into a quadrance.
Parameters:
| distance (double) | Distance measure. |
Returns: Quadrance.
DistanceToQuadrance
#Convert a distance into a quadrance.
Parameters:
| distance (float) | Distance measure. |
Returns: Quadrance.
DoubleIf<T>
#Perform a nested double conditional with greedy evaluation.
EdgeAverage
#Compute the average of the edges connecting a set of points.
Parameters:
| points (Point2d[]) |
EdgeAverage
#Compute the average of the edges connecting a set of points.
Parameters:
| points (Point3d[]) |
Erf
#Solves the Error function for a given argument. The Error function is a sigmoid like curve from (-infinity, 0) to (+infinity, 1).
Parameters:
| argument (double) | Argument. |
EstimateDecimals
#Given a valid numeric expression, estimates the number of decimals. This is just the number of digits following the first decimal separator.
Parameters:
| numericExpression (string) |
Returns: -1 if the number has no decimals at all, otherwise the number of digits following the decimal symbol.
ExtractSubmergedByFlipping
#Given a mesh, a water-level and the list of faces touching that lake, returns the part of the mesh *below* waterLevel by:
- flipping Z
- calling SplitMeshAtWaterLevels in single-lake mode
- flipping Z back
Factorial
#obsoleteUse the overload which takes a cancellation token.
Compute the factorial of a positive integer.
Parameters:
| n (BigInteger) | Integer to factorize. |
Returns: Logarithm of the binomial coefficient.
Factorial
#Compute the factorial of a positive integer.
Parameters:
| n (int) | Integer to factorize. |
| token (CancellationToken) | Cancellation token. |
Factorial
#Compute the factorial of n divided by the factorial of d.
Parameters:
| n (int) | N argument, must be one or higher. |
| d (int) | D argument, must be between one and n inclusive. |
| token (CancellationToken) | Cancellation token. |
Factorial
#obsoleteUse the overload which takes a cancellation token.
Compute the factorial of n divided by the factorial of d.
Factorial
#obsoleteUse the overload which takes a cancellation token.
Compute the factorial of a positive integer.
Parameters:
| n (int) | Integer to factorize. |
Factorial
#Compute the factorial of a floating point value using the Gamma function.
Parameters:
| x (double) | Value. |
| token (CancellationToken) | Cancellation token. |
Returns: Factorial of x.
Factorial
#obsoleteUse the overload which takes a cancellation token.
Compute the factorial of a floating point value using the Gamma function.
Parameters:
| x (double) | Value. |
Returns: Factorial of x.
FactorialInverse
#Compute the one-over-factorial of a positive integer.
Parameters:
| k (int) | Integer to reverse factorize. |
| token (CancellationToken) | Cancellation token. |
Returns: Inverse factorial of k.
FactorialInverse
#Compute the one-over-factorial of a positive integer.
Parameters:
| k (int) | Integer to reverse factorize. |
Returns: Inverse factorial of k.
FactorialLn
#Compute the natural logarithm of the factorial of an integer.
Parameters:
| k (int) | Integer to factorize. |
Returns: Logarithm of the binomial coefficient.
FindCubicRoots
#Find the real roots of the cubic equation ax^3 + bx^2 + cx + d = 0. The solutions are typically accurate to within roughly 1e-15, though they are included as real solutions if they yield zeros within 1e-12. You may want to perform additional checking to see whether you are happy using all roots.
FindFactors
#Find all the factors pairs for this integer. Pairs with 1xN are not included. If the integer is negative, the first factor is always negative while the second factor is always positive.
Parameters:
| integer (int) | Integer to factorize. |
Returns: Array of factor pairs.
FindLinearRoot
#Find the real root of the linear equation ax + b = 0.
FindMinimum
#Use the Brent minimizer provided by the Math.NET package to find where a function is lowest.
Parameters:
| function (Func<double, double>) | Function to sample. |
| lowerLimit (double) | Initial lower limit for the x-bracketing. |
| upperLimit (double) | Initial upper limit for the x-bracketing. |
| maximumIterations (int = 128) | Maximum number of iterations before the finder gives up. |
Returns: Result of search. Note that the found solution may be very good even if 'success' is false. And vice versa.
FindMonotoneY
#Find the parameter in a monotone increasing function which yields the given target.
FindQuadraticRoots
#Find the real roots of the quadradic equation ax^2 + bx + c = 0.
FindRoot
#Use the Brent root finder provided by the Math.NET package to find where a function equal zero or best approximates zero.
Parameters:
| function (Func<double, double>) | Function to sample. |
| lowerLimit (double) | Hard lower limit of function(x) argument. |
| upperLimit (double) | Hard upper limit of function(x) argument. |
| accuracy (double = 1E-08) | Desired accuracy. |
| maximumIterations (int = 64) | Maximum number of iterations before the finder gives up. |
FindRoot
#Find the root of a custom function using a robust Newton-Rhapson algorithm. This root finder requires a correct derivative.
Parameters:
| function (Func<double, double>) | Function to investigate. |
| derivative (Func<double, double>) | Derivative of function. |
| lower (double) | Lower limit for root search. |
| upper (double) | Upper limit for root search. |
| accuracy (double) | Desired accuracy. |
| maxAttempts (int) | Maximum allowed attempts. |
Returns: Found root or double.NaN
FindRootLoose
#Use the Brent root finder provided by the Math.NET package to find where a function equal zero or best approximates zero.
Parameters:
| function (Func<double, double>) | Function to sample. |
| lowerLimit (double) | Cue for lower limit of function(x) argument. This limit will be expanded if a solution cannot be found otherwise. |
| upperLimit (double) | Cue for upper limit of function(x) argument. This limit will be expanded if a solution cannot be found otherwise. |
| accuracy (double = 1E-08) | Desired accuracy. |
| maximumIterations (int = 64) | Maximum number of iterations before the finder gives up. |
Floor
#Default Grasshopper floor method.
Parameters:
| value (Complex) | Value to round. |
Returns: Rounded value.
Floor
#Default Grasshopper floor method.
Parameters:
| value (decimal) | Value to round. |
Returns: Rounded value.
Floor
#Default Grasshopper floor method.
Parameters:
| value (double) | Value to round. |
Returns: Rounded value.
Floor
#Default Grasshopper floor method.
Parameters:
| value (float) | Value to round. |
Returns: Rounded value.
Floor
#Default Grasshopper floor method.
Parameters:
| value (Point3d) | Value to round. |
Returns: Rounded value.
Floor
#Default Grasshopper floor method.
Parameters:
| value (Vector3d) | Value to round. |
Returns: Rounded value.
Gamma
#Computes the Gamma function for a real number.
Parameters:
| z (double) | Argument. |
Returns: Gamma value.
GammaLn
#Computes the natural logarithm of the Gamma function for a real number.
Parameters:
| z (double) | Argument. |
Returns: Gamma value.
GM
#Compute the Geometric mean of two numbers.
GM
#Compute the Geometric mean of two numbers.
GreatestCommonDivisor
#Compute the greates common divisor shared between two positive integers a and b. The GCD (x) of two numbers is the biggest integer for which it is possible to write a=x*i and b=x*j.
Parameters:
| a (BigInteger) | First integer. |
| b (BigInteger) | Second integer. |
Returns: Highest common factor.
GreatestCommonDivisor
#Compute the greates common divisor shared between a collection of positive integers a and b. The GCD (x) of a set of numbers is the biggest integer for which it is possible to write a=x*i, b=x*j, c=x*k, ...
Parameters:
| numbers (params BigInteger[]) | Array of integers. |
Returns: Greatest common divisor for all numbers.
GreatestCommonDivisor
#Compute the greates common divisor shared between two positive integers a and b. The GCD (x) of two numbers is the biggest integer for which it is possible to write a=x*i and b=x*j.
GreatestCommonDivisor
#Compute the greates common divisor shared between a collection of positive integers a and b. The GCD (x) of a set of numbers is the biggest integer for which it is possible to write a=x*i, b=x*j, c=x*k, ...
Parameters:
| numbers (params int[]) | Array of integers. |
Returns: Greatest common divisor for all numbers.
Hankel1
#Evaluate the Hankel function of the first kind.
Hankel2
#Evaluate the Hankel function of the second kind.
Harmonic
#Compute the Nth harmonic number. This is the sum of the reciprocals of the first N natural numbers.
Parameters:
| n (int) | Number index. |
Returns: The Nth harmonic number.
HarmonicGeneral
#Compute the Nth generalised harmonic number. This is the sum of the reciprocals of the first N natural numbers, all raised to the given exponent.
Hash
#Compute the hash value of the byte array.
Hash
#Compute the hash value of the byte array.
Hash
#Compute the hash value of a string.
Hash
#Compute the hash value of a string.
HM
#Compute the Harmonic mean of two numbers.
HM
#Compute the Harmonic mean of two numbers.
InfinitySign
#Sign implemented for infinities.
Parameters:
| value (double) | Value to test. |
Returns: -1 for negative infinity, +1 for positive infinity, 0 for finite values.
IntegralAndFractionalNormal
#Gets the normalised integral and fractional portions of a number within the repeated unit interval.
IntegrateExponentialTransform
#Approximate an integral using the double exponential transformation. This integrator is suitable for smooth functions with poles and discontinuous in the derivative.
IntegrateGaussLegendre
#Approximate an integral using the Gauss-Legendre rule. This integrator is suitable for polynomials with known degree.
IntegrateNewtonCotes
#Approximate an integral using the Newton-Cotes trapezoidal rule. This integrator often yields poor results, consider using IntegrateExponentialTransform(Func<double, double>, double, double, double) instead.
IntervalFraction
#Compute the fraction of the interval length defined by a value.
IsAnyInfinite
#Test whether any value is infinite.
Parameters:
| values (params double[]) | Value to check. |
Returns: True if all values are nan.
IsAnyNaN
#Test whether any value is NaN.
Parameters:
| values (params double[]) | Value to check. |
Returns: True if all values are nan.
IsPrime
#Test whether a given integer is a known prime. If the number is less than HighestCachedPrime then this lookup is O(1), otherwise it'll be slow.
Parameters:
| number (int) | Number to check. |
Returns: True if number is a known prime.
IsSquare
#Gets whether an integer is a perfect square.
IsSquare
#Gets whether an integer is a perfect square.
Parameters:
| integer (int) | Integer to test. |
Returns: True if the integer is a square.
Kurtosis
#Estimates the unbiased kurtosis of a population.
Parameters:
| data (IEnumerable<double>) | Population of values, must contain at least four numbers. |
Returns: Estimated kurtosis.
LeastCommonMultiple
#Compute the least common multiple of two numbers. The lcm is the smallest positive number that is a multiple of both a and b.
Parameters:
| a (BigInteger) | First integer. |
| b (BigInteger) | Second integer. |
Returns: Least common multiple.
LeastCommonMultiple
#Compute the least common multiple of two numbers. The lcm is the smallest positive number that is a multiple of both a and b.
LeastCommonMultiple
#Compute the least common multiple of a set of numbers. The lcm is the smallest positive number that is a multiple of a, b, c, ...
Parameters:
| numbers (params BigInteger[]) | Array of integers. |
Returns: Least common multiple.
LeastCommonMultiple
#Compute the least common multiple of a set of numbers. The lcm is the smallest positive number that is a multiple of a, b, c, ...
Parameters:
| numbers (params int[]) | Array of integers. |
Returns: Least common multiple.
LinearCrossing
#Linearly extrapolate or interpolate two coordinates to intersect a contant Y value.
LinearRegression
#Perform simple linear regression on a set of values, resulting in the linear equation f(x) = slope*x + intercept
Logistic
#Computes the Logistic function for custom parameters.
Logistic
#Computes the Logistic function for standard parameters.
Parameters:
| x (double) | Value. |
Returns: Logistic.
Logit
#Computes the inverse logistic function for custom parameters.
Logit
#Computes the inverse logistic function for standard parameters.
Parameters:
| x (double) | Value between zero and one. |
Returns: Logit.
LSystemIteration
#public static string LSystemIteration(string axiom, Dictionary<char, string> rules, CancellationToken token)
Apply a single L-System iteration.
Parameters:
| axiom (string) | Initial string. |
| rules (Dictionary<char, string>) | Set of rules. |
| token (CancellationToken) | Cancellation token. |
Returns: Modified string.
LSystemIteration
#Apply a single L-System iteration.
Parameters:
| axiom (string) | Initial string. |
| rules (params (char symbol, string expansion)[]) | Set of rules. |
Returns: Modified string.
Max
#Find the largest integer in a set.
Parameters:
| a (BigInteger) | |
| b (BigInteger) |
Returns: Maximum of all supplied values.
Max
#Find the largest integer in a set.
Parameters:
| values (params BigInteger[]) |
Returns: Maximum of all supplied values.
Max
#Create a complex value consisting of the largest real and imaginary parts.
Max
#Find the largest decimal in a set.
Parameters:
| values (params decimal[]) |
Returns: Maximum of all supplied values.
Max
#Find the largest double in a set.
Max
#Find the largest double in a set.
Max
#Find the largest double in a set.
Parameters:
| values (params double[]) |
Returns: Maximum of all supplied values.
Max
#Find the largest float in a set.
Max
#Find the largest float in a set.
Max
#Find the largest float in a set.
Parameters:
| values (params float[]) |
Returns: Maximum of all supplied values.
Max
#Find the largest integer in a set.
Max
#Find the largest integer in a set.
Max
#Find the largest integer in a set.
Parameters:
| values (params int[]) |
Returns: Maximum of all supplied values.
Max
#Create a point with the largest three components.
Max
#public static Size Max(Size a, Size b)
Find the biggest dimensions of two sizes.
Parameters:
| a (Size) | First size. |
| b (Size) | Second size. |
Returns: Highest of all supplied values.
Max
#public static SizeF Max(SizeF a, SizeF b)
Find the biggest dimensions of two sizes.
Parameters:
| a (SizeF) | First size. |
| b (SizeF) | Second size. |
Returns: Highest of all supplied values.
Max
#Create a vector with the largest three components.
MaxIndex
#Find the index of the largest integer in a set.
Parameters:
| values (params BigInteger[]) |
Returns: Index of largest value.
MaxIndex
#Find the index of the largest decimal in a set.
Parameters:
| values (params decimal[]) |
Returns: Index of largest value.
MaxIndex
#Find the index of the largest double in a set.
Parameters:
| values (params double[]) |
Returns: Index of largest value.
MaxIndex
#Find the index of the largest float in a set.
Parameters:
| values (params float[]) |
Returns: Index of largest value.
MaxIndex
#Find the index of the largest integer in a set.
Parameters:
| values (params int[]) |
Returns: Index of largest value.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<Complex>) | Data to measure. |
Returns: Mean.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<BigInteger>) | Data to measure. |
Returns: Mean.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<double>) | Data to measure. |
Returns: Mean.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<int>) | Data to measure. |
Returns: Mean.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<Point3d>) | Data to measure. |
Returns: Mean.
Mean
#Compute the mean of a data set.
Parameters:
| kind (Maths.MeanKind) | Kind of mean to estimate. |
| data (IEnumerable<Vector3d>) | Data to measure. |
Returns: Mean.
Median
#Gets the median of a collection of doubles.
Parameters:
| values (IEnumerable<double>) | Value for median. |
Median
#Gets the median of a collection of floats.
Parameters:
| values (IEnumerable<float>) | Value for median. |
Median
#Gets the median of a collection of integers.
Parameters:
| values (IEnumerable<int>) | Value for median. |
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params Complex[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params decimal[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params double[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic integral mean of a data set.
Parameters:
| values (params int[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params float[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params Point3d[]) | Value to average. |
Returns: Mean.
Mid
#Compute the arithmetic mean of a data set.
Parameters:
| values (params Vector3d[]) | Value to average. |
Returns: Mean.
MidIntegral
#Compute the arithmetic integral mean of a data set.
Parameters:
| values (params BigInteger[]) | Value to average. |
Returns: Mean.
MidIntegral
#Compute the arithmetic integral mean of a data set.
Parameters:
| values (params int[]) | Value to average. |
Returns: Mean.
Min
#Find the smallest integer in a set.
Parameters:
| a (BigInteger) | |
| b (BigInteger) |
Returns: Minimum of all supplied values.
Min
#Find the smallest integer in a set.
Parameters:
| values (params BigInteger[]) |
Returns: Minimum of all supplied values.
Min
#Create a complex value consisting of the smallest real and imaginary parts.
Min
#Find the smallest decimal in a set.
Parameters:
| values (params decimal[]) |
Returns: Minimum of all supplied values.
Min
#Find the smallest double in a set.
Min
#Find the smallest double in a set.
Min
#Find the smallest double in a set.
Parameters:
| values (params double[]) |
Returns: Minimum of all supplied values.
Min
#Find the smallest float in a set.
Min
#Find the smallest float in a set.
Min
#Find the smallest float in a set.
Parameters:
| values (params float[]) |
Returns: Minimum of all supplied values.
Min
#Find the smallest integer in a set.
Min
#Find the smallest integer in a set.
Min
#Find the smallest integer in a set.
Parameters:
| values (params int[]) |
Returns: Minimum of all supplied values.
Min
#Create a point with the smallest three components.
Min
#public static Size Min(Size a, Size b)
Find the smallest dimensions of two sizes.
Parameters:
| a (Size) | First size. |
| b (Size) | Second size. |
Returns: Lowest of all supplied values.
Min
#public static SizeF Min(SizeF a, SizeF b)
Find the smallest dimensions of two sizes.
Parameters:
| a (SizeF) | First size. |
| b (SizeF) | Second size. |
Returns: Lowest of all supplied values.
Min
#Create a vector with the smallest three components.
MinIndex
#Find the index of the smallest integer in a set.
Parameters:
| values (params BigInteger[]) |
Returns: Index of smallest value.
MinIndex
#Find the index of the smallest decimal in a set.
Parameters:
| values (params decimal[]) |
Returns: Index of smallest value.
MinIndex
#Find the index of the smallest double in a set.
Parameters:
| values (params double[]) |
Returns: Index of smallest value.
MinIndex
#Find the index of the smallest float in a set.
Parameters:
| values (params float[]) |
Returns: Index of smallest value.
MinIndex
#Find the index of the smallest integer in a set.
Parameters:
| values (params int[]) |
Returns: Index of smallest value.
MinMax
#Distribute two values by magnitude.
Parameters:
| a (BigInteger) | First value. |
| b (BigInteger) | Second value. |
| min (out BigInteger) | Lowest of a and b. |
| max (out BigInteger) | Highest of a and b. |
MinMax
#Distribute two values by magnitude.
MinMax
#Distribute two values by magnitude.
MinMax
#Distribute two values by magnitude.
MinMax
#Distribute two values by magnitude.
Multiple
#Default Grasshopper multiple method.
Multiple
#Default Grasshopper multiple method.
Multiple
#Count the number of times one value fits inside another.
Parameters:
| A (double) | Main value. |
| a (double) | Partial value. |
| method (Maths.MultipleMethod) | Counting method. |
Multiple
#Default Grasshopper multiple method.
Multiple
#Default Grasshopper multiple method.
Multiple
#Default Grasshopper multiple method.
Multiple
#Default Grasshopper multiple method.
MySplitMeshAtWaterLevels
#Splits a mesh by multiple lakes at once. Returns:
- Dry: everything never below *any* lake.
- Submerged[i]: the pieces under lake #i.
Parameters:
| inputMesh (Mesh) | |
| waterLevelsPerVertex (double[]) | |
| lakes ((double waterLevel, HashSet<int> wetFaces)[]) | |
| ct (CancellationToken) | |
| dryOnly (bool = false) |
NansAndInfinities
#Count all nans and infinities in a collection of doubles.
Normalise
#Normalise four value so that their sum is equal to target.
Normalise
#Normalise three value so that their sum is equal to target.
Normalise
#Normalise two value so that their sum is equal to target.
NthPermutation
#Compute the Nth permutation of an integer sequence using standard permutation patterns.
Parameters:
| sequenceLength (int) | Number of elements to permute. |
| n (int) | Permutation index to create. |
| token (CancellationToken) | Cancellation token. |
Returns: The Nth permutation containing all the integers between zero and n-1 inclusive.
NthPrime
#Gets the Nth prime number.
Parameters:
| n (int) | Nth prime. N may range from 1 to PrimeCount. |
Returns: Prime associated with index.
Parse
#Parse a notation possibly containing constants and exponents. This method starts with the Framework integer parser, then checks for Grasshopper scientific notation.
Parameters:
| notation (string) | Notation to parse. |
| value (out BigInteger) | Value which seemed to be implied. |
Returns: True if parsing worked.
Parse
#Parse a notation possibly containing constants and exponents. This method starts with the Framework decimal parser, then checks for Grasshopper scientific notation, and finally considers multiples of pi.
Parse
#Parse a notation possibly containing constants and exponents. This method starts with the Framework double parser, then checks for Grasshopper scientific notation, and finally considers multiples of pi.
Parse
#Parse a notation possibly containing constants and exponents. This method starts with the Framework integer parser, then checks for Grasshopper scientific notation.
ParseNumberAt
#Try and parse a number from a sub-string. Note that this method does *not* pay attention to the preceding characters in the string. It only looks ahead. Types of notation this method understands include:
Straight up integers: 1, 8, -500000
Straight up floats: 4.8, -600.8, -.5
Scientific notation: 1e-6, -7.078e200, 5*10^20, 5·10², 55×10³
Pi suffixes: π, 5π, 0.5pi
Imaginary suffixes: i, 45.7i
Degree symbols: 45°, -180.5°
Parameters:
| notation (string) | String containing a potential number. |
| start (int) | Index to start parsing from. |
| end (out int) | Index *after* the parsed number on success, or just 'start' if parsing did not succeed. |
| value (out object) | Numeric value. Either an int, a BigInteger, a double, a Complex, or an Angle. |
Returns: True if a number could be parsed from the substring.
Permutations
#public static IEnumerable<Maths.IndexMap> Permutations(int n, CancellationToken token, Random random = null)
Generate random permutations.
Parameters:
| n (int) | Length of list to permute. |
| token (CancellationToken) | Cancellation token. |
| random (Random = null) | Random engine for permutation shuffling. |
Ping
#Ping-pong a value between two limits.
Parameters:
| value (BigInteger) | Value to clip. |
| min (BigInteger) | Inclusive lower limit. |
| max (BigInteger) | Inclusive upper limit. |
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
Ping
#Ping-pong a value between two limits.
PrimeFactors
#Decompose an integer into its prime factors, each combined with the power it is raised to. Factors are ordered from small to large, and the product of all factors always equals the absolute value of the input. The sign of the input is ignored, -12 and +12 both decompose into 2² and 3.
Parameters:
| integer (int) | Integer to decompose. Zero is not a valid input. |
Returns: Prime factors and their multiplicities. Empty if the input is ±1.
QuadranceToDistance
#Convert a quadrance into a distance.
Parameters:
| quadrance (double) | Quadrance measure. |
Returns: Distance.
QuadranceToDistance
#Convert a quadrance into a distance.
Parameters:
| quadrance (float) | Quadrance measure. |
Returns: Distance.
Round
#Default Grasshopper rounding method.
Round
#Default Grasshopper rounding method.
Round
#Default Grasshopper rounding method.
Round
#Default Grasshopper rounding method.
Round
#Default Grasshopper rounding method.
Round
#Default Grasshopper rounding method.
RoundWithinError
#Round a value to the nearest 'nice' value, without exceeding the error margin.
Sec
#Compute the secant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Secant of angle.
Sec
#Compute the secant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Secant of angle.
Sech
#Compute the hyperbolic secant of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic secant of angle.
Sech
#Compute the hyperbolic secant of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic secant of angle.
Sin
#Compute the sine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Sine of angle.
Sin
#Compute the sine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Sine of angle.
Sinc
#Compute the sinus-cardinalis of an angle in radians.
Sinc
#Compute the sinus-cardinalis of an angle in radians.
Sinh
#Compute the hyperbolic sine of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic sine of angle.
Sinh
#Compute the hyperbolic sine of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic sine of angle.
Skewness
#Estimates the unbiased skewness of a population.
Parameters:
| data (IEnumerable<double>) | Population of values, must contain at least three numbers. |
Returns: Estimated skewness.
Smooth
#Smooth a set of values, ignoring everything beyond the ends of the sequence.
Parameters:
| kind (Maths.SmoothKind) | Smoothing algorithm. |
| radius (int) | Smoothing radius. |
| inclusive (bool) | If true, the value itself is taken into account. |
| data (double[]) | Data to smooth. |
Returns: Smoothed data.
Smooth
#public static double[] Smooth(SmoothKind kind, int radius, bool inclusive, SmoothEdge edge, double[] data)
Smooth a set of values.
Parameters:
| kind (Maths.SmoothKind) | Smoothing algorithm. |
| radius (int) | Smoothing radius. |
| inclusive (bool) | If true, the value itself is taken into account. |
| edge (Maths.SmoothEdge) | Treatment of values beyond the ends of the sequence. |
| data (double[]) | Data to smooth. |
Returns: Smoothed data.
SmootherStep
#Performs standard smootherstep blending on a value. If the value is less than edge0, zero is returned. If the value exceeds edge1, one is returned. In between the value is blended using a fifth order hermite polynomial.
SmootherStep
#Performs standard smootherstep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmootherStepDerivative
#Differentiate standard smootherstep blending on a value.
SmootherStepDerivative
#Differentiate standard smootherstep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmoothestStep
#Performs standard smootheststep blending on a value. If the value is less than edge0, zero is returned. If the value exceeds edge1, one is returned. In between the value is blended using a seventh order hermite polynomial.
SmoothestStep
#Performs standard smootheststep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmoothestStepDerivative
#Differentiate standard smootheststep blending on a value.
SmoothestStepDerivative
#Differentiate standard smootheststep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmoothMax
#public static double SmoothMax(double a, double b, SmoothLimit function = SmoothLimit.Polynomial, double k = 1)
Compute the smooth maximum of two numbers. When applied to continuous crossing functions, the smooth maximum yields a result identical to Max(a, b), except when a and b are nearly equal. Near crossing points this deviation from Max(a,b) becomes so large as to smooth out the kinks that would occur in the regular Max() function.
Parameters:
| a (double) | First value. |
| b (double) | Second value. |
| function (Maths.SmoothLimit = SmoothLimit.Polynomial) | Smoothing function to use. |
| k (double = 1) | Width of the blend zone (in the same units as a and b). |
Returns: The smooth maximum of a and b.
SmoothMin
#public static double SmoothMin(double a, double b, SmoothLimit function = SmoothLimit.Polynomial, double k = 1)
Compute the smooth minimum of two numbers. When applied to continuous crossing functions, the smooth minimum yields a result identical to Min(a, b), except when a and b are nearly equal. Near crossing points this deviation from Min(a,b) becomes so large as to smooth out the kinks that would occur in the regular Min() function.
Parameters:
| a (double) | First value. |
| b (double) | Second value. |
| function (Maths.SmoothLimit = SmoothLimit.Polynomial) | Smoothing function to use. |
| k (double = 1) | Blending argument. The 'k' parameter has a different meaning depending on the smoothing function. |
Returns: The smooth minimum of a and b.
SmoothStep
#Performs standard smoothstep blending on a value. If the value is less than edge0, zero is returned. If the value exceeds edge1, one is returned. In between the value is blended using a hermite polynomial.
SmoothStep
#Performs standard smoothstep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmoothStepDerivative
#Differentiate standard smoothstep blending on a value.
SmoothStepDerivative
#Differentiate standard smoothstep blending on a value between zero and one.
Parameters:
| x (double) | Value to smooth. |
Returns: Smoothed value.
SmoothStepInverse
#Inverse of the cubic smoothstep function.
Parameters:
| x (double) | Value to (un)smooth. |
Returns: (Un)smoothed value.
Sort
#Sort three values in place.
Sort
#Sort two values in place.
Sort
#Sort three values in place.
Sort
#Sort two values in place.
Sort
#Sort three values in place.
Sort
#Sort two values in place.
Sort
#Sort three values in place.
Sort
#Sort two values in place.
SortAngular
#Sort an array of points counter-clockwise.
SortAngular
#Sort an array of points counter-clockwise.
SortAngular
#Sort an array of points counter-clockwise.
Parameters:
| points (Point2d[]) | Points to sort. |
Returns: Sorted indices.
SortTopological
#Perform a topological sorting on an array of dependendies.
Parameters:
| dependencies (int[][]) | An array of indexed dependencies. Empty or null array are allowed, indicating the element has no dependencies. |
Returns: An index map which can be used to synchronously sort.
SplitMeshByPlane
#Split a mesh by an arbitrary plane. Returns the parts above and the parts below the plane as two separate meshes (each potentially comprising several disjoint pieces; call
SplitDisjointPieces to enumerate them), plus the cut polylines on the plane itself. Unlike Mesh.Split(Plane) in RhinoCommon this overload accepts a cancellation token and bails out cleanly on a long-running split. Quad faces that lie entirely above or entirely below the plane are preserved as quads in the output. Only quads that the plane actually crosses are triangulated (along the A-C diagonal) and split per triangle. The input mesh is never mutated. Vertices within tolerance of the plane are treated as lying on the plane (rather than strictly above or below). A face with an on-plane vertex and no strict-opposite-side vertex is assigned in full to whichever side it touches; this gives clean splits on meshes whose vertices land exactly on the plane (the default sphere mesh, for example, has a row of vertices at the equator). See also MySplitMeshAtWaterLevels(Mesh, double[], (double waterLevel, HashSet<int> wetFaces)[], CancellationToken, bool), which solves a related but more specialised problem (multiple horizontal-plane cuts with per-vertex water levels and terrain-flavoured output bookkeeping). The two share the same per-triangle split arithmetic; they are not yet refactored onto a common core because the terrain method is sensitive to small numerical changes in its output.Parameters:
| inputMesh (Mesh) | |
| plane (Plane) | |
| tolerance (double) | |
| ct (CancellationToken) |
Statistics
#Compute a set of common statistics for a collection of numbers.
Statistics
#Compute a set of common statistics for a collection of numbers.
Parameters:
| numbers (double[]) | Numbers to investigate. |
| mean (out double) | Mean (or average) of numbers. |
| mode (out double) | Mode of numbers. Note that this is particularly sensitive to floating point noise. Round your values first if you really care. |
| median (out double) | Median of numbers. |
| deviation (out double) | Standard deviation of numbers. |
Sum<T>
#Sum up all elements in a collection.
Parameters:
| collection (IEnumerable<T>) | Collection of elements. |
| method (Func<T, double>) | Element to double conversion. |
Returns: Sum total.
Sum<T>
#Sum up all elements in a collection.
Parameters:
| collection (IEnumerable<T>) | Collection of elements. |
| method (Func<T, float>) | Element to float conversion. |
Returns: Sum total.
Sum<T>
#Sum up all elements in a collection.
Parameters:
| collection (IEnumerable<T>) | Collection of elements. |
| method (Func<T, int>) | Element to integer conversion. |
Returns: Sum total.
Swap<T>
#public static void Swap<T>(ref T a, ref T b, ref T c)
Swap three values in place. B becomes A, C becomes B, and A becomes C.
Parameters:
| a (ref T) | First value. |
| b (ref T) | Second value. |
| c (ref T) | Third value. |
Swap<T>
#public static void Swap<T>(ref T a, ref T b)
Swap two values in place.
Parameters:
| a (ref T) | First value. |
| b (ref T) | Second value. |
Tan
#Compute the tangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Tangent of angle.
Tan
#Compute the tangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Tangent of angle.
Tanh
#Compute the hyperbolic tangent of a complex value.
Parameters:
| value (Complex) | Complex value. |
Returns: Hyperbolic tangent of angle.
Tanh
#Compute the hyperbolic tangent of an angle in radians.
Parameters:
| angle (double) | Angle in radians. |
Returns: Hyperbolic tangent of angle.
ToNextPowerOfTen
#Convert an integer to the next power of ten. If the integer is already a power of ten, the same number will be returned.
Parameters:
| integer (int) | Integer to convert. |
Returns: Power of ten.
ToNextPowerOfTwo
#Convert an integer to the next power of two. If the integer is already a power of two, the same number will be returned.
Parameters:
| integer (int) | Integer to convert. |
Returns: Power of two.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (Complex) | Value to round. |
Returns: Rounded value.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (decimal) | Value to round. |
Returns: Rounded value.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (double) | Value to round. |
Returns: Rounded value.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (float) | Value to round. |
Returns: Rounded value.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (Point3d) | Value to round. |
Returns: Rounded value.
Truncate
#Default Grasshopper truncate method.
Parameters:
| value (Vector3d) | Value to round. |
Returns: Rounded value.
Wrap
#Wrap a value between two limits.
Parameters:
| value (BigInteger) | Value to clip. |
| min (BigInteger) | Inclusive lower limit. |
| max (BigInteger) | Exclusive upper limit. |
Wrap
#Wrap a value between two limits.
Wrap
#Wrap a value between two limits.
Wrap
#Wrap a value between two limits.
Wrap
#Wrap a value between two limits.
Wrap
#Wrap a value between two limits.
Wrap
#Wrap a value between two limits.