Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyFunction
- {
- public static float Fu(float x, float a)
- {
- float f;
- f = 1 / (a * x) + 1 / (x + 1) + 1 / ( x + 2);
- return f;
- }
- public static void Function1(int N, float a, out float xmin, out float xmax, out float ymin, out float ymax, ref float[] arx, ref float[] ary)
- {
- float[] ax, ay;
- ax = new float[N-2];
- ay = new float[N-2];
- for (int j = -(N-2)/2, i = 0; j <= (N-2)/2; j++)
- {
- if (((j / 100.0 ) == 0) || (( j / 100.0 ) == -1) || (( j / 100.0 ) == -2)) continue;
- ax[i] = (float)(j / 100.0 );
- ay[i] = (float)MyFunction.Fu(ax[i], a);
- i++;
- }
- xmin = ax.Min();
- xmax = ax.Max();
- ymax = ay.Max();
- ymin = ay.Min();
- arx = ax;
- ary = ay;
- }
- public static void Function2(int N, float a, float del, out float xminl, out float xmaxl, out float yminl, out float ymaxl, ref float[] arxl, ref float[] aryl)
- {
- float[] ax, ay;
- ax = new float[N - 2];
- ay = new float[N - 2];
- for (int j = -(N - 2) / 2, i = 0; j <= (N - 2) / 2; j++)
- {
- if (((j / 100.0) == 0) || ((j / 100.0) == -1) || ((j / 100.0) == -2)) continue;
- ax[i] = (float)(j / 100.0);
- ay[i] = (float)((Fu(ax[i]+del, a)-Fu(del,a))/del);
- i++;
- }
- xminl = ax.Min();
- xmaxl = ax.Max();
- ymaxl = ay.Max();
- yminl = ay.Min();
- arxl = ax;
- aryl = ay;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement