HI,
Could any one please help me to find slope for given value of x and y using functions.
Given value in the sense list of x and list of y values.
Thanks & Regards,
Reks
Visual C# General
HI,
Could any one please help me to find slope for given value of x and y using functions.
Given value in the sense list of x and list of y values.
Thanks & Regards,
Reks
A line is a two-dimensional entity, you need only two x,y values to calculate slope.
If you're got a list of x,y values, then you're probably doing smoothing or trend lines; each of which suite specific needs. Arbitrarily picking one of those isn't going to help you, please provide more detail for what you're trying to accomplish.
I think what he wanted to do is the following:
public int GetSlope(int[] y, int x)
{
return (y[x + 1] - y[x]) / sampleRate;
}