xatymin

 

Description

Get the value of X at the minimum Y value of a curve.

Syntax

double xatymin( Curve & crv )

Parameters

crv
[input] Origin C Curve object

Return

Returns the value of X at the minimum Y value of a curve.

Examples

EX1

// This is a self contained sample program for the function xatymin, 
// Its sample data is created at the beginning of the program. 
// To run the program, enter the following command in the Script window:
//   xatymin_ex1
// This will return the result like following:
//   X(Data2_A) at Minimum of Y(Data2_B) = 2

void xatymin_ex1()
{
    double dXatYmin;
    
    Worksheet wks;
    wks.Create();
    Dataset myXDs(wks,0);
    String strXName = myXDs.GetName();
    Dataset myYDs(wks,1);
    String strYName = myYDs.GetName();
    
    //******* Create sample data *****************
    myXDs.SetSize(8);
    myYDs.SetSize(8);
    myXDs[3]=1;    myYDs[3]=0.3; 
    myXDs[5]=2;    myYDs[5]=0.097; 
    myXDs[2]=3;    myYDs[2]=0.41256; 
    myXDs[6]=4;    myYDs[6]=0.24909;
    myXDs[1]=5;    myYDs[1]=0.47304;
    myXDs[4]=6;    myYDs[4]=0.2476;
    myXDs[7]=7;    myYDs[7]=0.64529;
    myXDs[0]=8;    myYDs[0]=0.44514; 
    //******** End of Sample Data Creation *******

    Curve myCrv(myXDs,myYDs);    // Create a Curve object    
    
    dXatYmin = xatymin(myCrv);  // Demonstration of xatymin
    
    printf("X(%s) at Minimum of Y(%s) = %g\n",strXName,strYName,dXatYmin);

}

Remark

Get the value of X at the minimum Y value of a curve.

See Also

Xatymax

Header to Include

origin.h

Reference