# Input list of points into equation

I am trying to solve for central difference for the following set of points and function;

f[x_, y_] = x + x/(x^2 + y^2);

pnts2 = {{-1.6, 0.4}, {-1.6, 0.6}, {-1.6, 0.8}, {-1.6, 1.}, {-1.6,
1.2}, {-1.6, 1.4}, {-1.6, 1.6}, {-1.6, 1.8}, {-1.4, 0.4}, {-1.4,
0.6}, {-1.4, 0.8}, {-1.4, 1.}, {-1.4, 1.2}, {-1.4, 1.4}, {-1.4,
1.6}, {-1.4, 1.8}, {-1.2, 0.4}, {-1.2, 0.6}, {-1.2, 0.8}, {-1.2,
1.}, {-1.2, 1.2}, {-1.2, 1.4}, {-1.2, 1.6}, {-1.2, 1.8}, {-1.,
0.4}, {-1., 0.6}, {-1., 0.8}, {-1., 1.}, {-1., 1.2}, {-1.,
1.4}, {-1., 1.6}, {-1., 1.8}, {-0.8, 0.8}, {-0.8, 1.}, {-0.8,
1.2}, {-0.8, 1.4}, {-0.8, 1.6}, {-0.8, 1.8}, {-0.6, 1.}, {-0.6,
1.2}, {-0.6, 1.4}, {-0.6, 1.6}, {-0.6, 1.8}, {-0.4, 1.}, {-0.4,
1.2}, {-0.4, 1.4}, {-0.4, 1.6}, {-0.4, 1.8}, {-0.2, 1.}, {-0.2,
1.2}, {-0.2, 1.4}, {-0.2, 1.6}, {-0.2, 1.8}, {0., 1.2}, {0.,
1.4}, {0., 1.6}, {0., 1.8}, {0.2, 1.}, {0.2, 1.2}, {0.2,
1.4}, {0.2, 1.6}, {0.2, 1.8}, {0.4, 1.}, {0.4, 1.2}, {0.4,
1.4}, {0.4, 1.6}, {0.4, 1.8}, {0.6, 1.}, {0.6, 1.2}, {0.6,
1.4}, {0.6, 1.6}, {0.6, 1.8}, {0.8, 0.8}, {0.8, 1.}, {0.8,
1.2}, {0.8, 1.4}, {0.8, 1.6}, {0.8, 1.8}, {1., 0.4}, {1.,
0.6}, {1., 0.8}, {1., 1.}, {1., 1.2}, {1., 1.4}, {1., 1.6}, {1.,
1.8}, {1.2, 0.4}, {1.2, 0.6}, {1.2, 0.8}, {1.2, 1.}, {1.2,
1.2}, {1.2, 1.4}, {1.2, 1.6}, {1.2, 1.8}, {1.4, 0.4}, {1.4,
0.6}, {1.4, 0.8}, {1.4, 1.}, {1.4, 1.2}, {1.4, 1.4}, {1.4,
1.6}, {1.4, 1.8}, {1.6, 0.4}, {1.6, 0.6}, {1.6, 0.8}, {1.6,
1.}, {1.6, 1.2}, {1.6, 1.4}, {1.6, 1.6}, {1.6, 1.8}, {1.8,
0.4}, {1.8, 0.6}, {1.8, 0.8}, {1.8, 1.}, {1.8, 1.2}, {1.8,
1.4}, {1.8, 1.6}, {1.8, 1.8}};


I have coded the formula for central difference as follows;

p[x_, y_] := [(x + .2) + (x + .2)/(((x + .2)^2) + (y^2))];
q[x_, y_] := [(x - .2) + (x - .2)/(((x - .2)^2) + (y^2))];
r[x_, y_] := [x + ((x)/((x^2) + ((y + .2)^2)))];
z[x_, y_] := [x + ((x)/((x^2) + ((y - .2)^2)))];
changeofx = D[f[x, y], x];
changeofy = D[f[x, y], y];
centraldiff = {((p - q)/(2*changeofx)), ((r - z)/(2*changeofy))};
centraldiff @@ pnts2


I thought doing @@@pnt2 after defining each variable would give me a list of point outputs for change of x and y, but it just multiplies it to the entire function instead. How do I get the centraldiff function to take in one point (x,y), from the list defined for pnt2, at a time?

• The centraldiff = (p/(2*changeofx), q/changeofy) is obviously wrong. Then, compare the following three samples and think about what's wrong with the last two: 1. func[x_, y_] := x + y; func @@ {1, 2} 2. (x + y) @@ {1, 2} 3. func[x_, y_] := x + y; func[x, y] @@ {1, 2} – xzczd Nov 27 '19 at 5:13
• You continue to misuse brackets (e.g., definition of centraldiff). Read the documentation. – Bob Hanlon Nov 27 '19 at 5:32
• The previous example applied the points to the equation by just listing "@@@" then the specified point list after the defined equation. Which I assumed I could just reapply to this as it is the same concept but different equation. The equation should be fixed now. I have implemented the use of brackets to define my centraldiff function and tried to follow the example which with you have commented. But I am receiving the error "Assuming suppressed output". – subrinarafiq Nov 27 '19 at 6:16
• No, it's not fixed at all. You're just guessing the syntax wildly based on the code you've obtained. Once again, please make some effort to understand the answers and comments you've obtained so far by reading the document, the link given by @Bob in the comment under your previous question is a starting point. – xzczd Nov 27 '19 at 6:27
• To either Map or Apply a function, the function must be defined with argument(s) either explicitly (e.g., f[x_, y_] := x + y) or implicitly using a pure Function (e.g., f = #1 + #2 &). The previous solutions provided to you defined the mapped/applied functions in one of these manners. – Bob Hanlon Nov 27 '19 at 15:46