Skip to main content

Curve Method

Returns the y value of a curve given the x value.

Definition​

Namespace: GHost.GSharp.Analytics.AF
Assembly: GHost.GSharp.Analytics.AF (in GHost.GSharp.Analytics.AF.dll) Version: 1.2.0.0 (1.2.44.3)

C#

public static double Curve(
double x,
Object xs,
Object ys
)

VB

Public Shared Function Curve ( 
x As Double,
xs As Object,
ys As Object
) As Double

Parameters​

  Double
A numeric value where the curve needs to be evaluated.
  Object
An array of numeric values representing the x-coordinates of the curve.
  Object
An array of numeric values representing the y-coordinates of the curve.

Return Value​

Double
Returns the y value of a curve given the x value.

Remarks​

The function does not extrapolate and the xs should be sorted with strictly increasing order. Raises an exception if there is at least one non-numeric value in xs or ys, or if their dimensions do not match.

Example​

C#

double x = 0.5;
double[] xs = [0, 1, 2];
double[] ys = [2, 3, 4];
double result = Curve(x, xs, ys); // returns 2.5

Exceptions​

ArgumentException

See Also​

Reference​

FunctionLibrary Class
GHost.GSharp.Analytics.AF Namespace