# yatasymt

## Description

Get the value of Y at a horizontal asymptote.

## Syntax

double yatasymt( Curve & crv )


## Parameters

crv
[input] curve whose asymptote is found

## Return

Returns the value of Y at a horizontal asymptote.

## Examples

EX1

// This is a self contained sample program for the function yatasymt,
// Its sample data is created at the beginning of the program.
// To run the program, enter the following command in the Script window:
//   xatasymt_ex1
// It returns like:
//   The value of Y at the horizontal asymptote of X(Data3_A) = -3.000000

void yatasymt_ex1()
{
double dyatasymt;

Worksheet wks;
wks.Create();
Dataset myXDs(wks,0);
String strXName = myXDs.GetName();
Dataset myYDs(wks,1);

//******* Create sample data *****************
myXDs.SetSize(13);
myYDs.SetSize(13);
myXDs[0]=-20;     myYDs[0]=-3.04762;
myXDs[1]=-14;     myYDs[1]=-3.06667;
myXDs[2]=-8;     myYDs[2]=-3.11111;
myXDs[3]=-2;     myYDs[3]=-3.33333;
myXDs[4]=-1;     myYDs[4]=-3.5;
myXDs[5]=0;     myYDs[5]=-4;
myXDs[6]=1;     myYDs[6]=NANUM;
myXDs[7]=2;     myYDs[7]=-2;
myXDs[8]=3;     myYDs[8]=-2.5;
myXDs[9]=4;     myYDs[9]=-2.66667;
myXDs[10]=10;     myYDs[10]=-2.88889;
myXDs[11]=16;     myYDs[11]=-2.93333;
myXDs[12]=22;     myYDs[12]=-2.95238;
//******** End of Sample Data Creation *******

Curve myCrv(myXDs,myYDs);    // Create a Curve object

dyatasymt = yatasymt(myCrv);  // Demonstration of xatasymt

printf("The value of Y at the horizontal asymptote of X(%s) = %f\n",
strXName,dyatasymt);
}


## Remark

The function used for fitting function parameter initialization.

Get the value of Y at a horizontal asymptote. If the asymptote has two branches then Y is defined as Y = (yatxmax+yatxmin)/2 and if the asymptote has a single branch then Y is defined as either yatxmax or yatxmin depending on where the slope of the curve is closest to zero.