One could be made. Its not terribly hard if you can make a few approximations. While I agree that mathematica and matlab are the ways to go for pro users. There are still some free alternatives that come to mind:
But if you insist on using a Photoshop as a hammer here you go (who am I to argue):
#target photoshop
var doc = app.activeDocument;
// place your function here
// put t in second array item if you dont want a 2d parametric plot
function graphMeParametrically(t) {
return new Array(
20 * Math.sin(t) + 30,
20 * Math.cos(t) +30
);
}
// plot half arc centered on 30, 30
plotLinear(0., 3.14/10, 3.14, graphMeParametrically);
// ok so we could do better by estimating the curvature of a continnious function
plotSmooth(0., 3.14/10, 3.14, 0.01, graphMeParametrically);
function plotLinear(start, step, end, func){
var points = new Array();
var index = 0;
for (var t =start; t <= end; t+=step) {
points.push(new PathPointInfo());
points[index].kind = PointKind.CORNERPOINT;
points[index].anchor = func(t);
points[index].leftDirection = points[index].anchor;
points[index].rightDirection = points[index].anchor;
index+=1;
}
var subPath = new Array();
subPath.push(new SubPathInfo());
subPath[0].operation = ShapeOperation.SHAPEXOR;
subPath[0].closed = false;
subPath[0].entireSubPath = points;
doc.pathItems.add("", subPath);
}
// this is a very dirty and naive estimation
// now updated version
function plotSmooth(start, step, end, delta, func){
var points = new Array();
var index = 0;
for (var t =start; t <= end; t+=step) {
points.push(new PathPointInfo());
points[index].kind = PointKind.SMOOTHPOINT;
now = func(t);
next = func(t + step);
mag = Math.sqrt(Math.pow(next[0] - now[0], 2) + Math.pow(next[1] - now[1], 2)) /3;
t1 = func(t + delta);
t2 = func(t - delta);
mag2 = Math.sqrt(Math.pow(t1[0] - t2[0], 2) + Math.pow(t1[1] - t2[1], 2))
tan1 = new Array(now[0]-mag/mag2*(t2[0] - t1[0]), now[1]-mag/mag2*(t2[1] - t1[1]))
tan2 = new Array(now[0]+mag/mag2*(t2[0] - t1[0]), now[1]+mag/mag2*(t2[1] - t1[1]))
points[index].anchor = now;
points[index].leftDirection = tan1;
points[index].rightDirection = tan2;
index+=1;
}
var subPath = new Array();
subPath.push(new SubPathInfo());
subPath[0].operation = ShapeOperation.SHAPEXOR;
subPath[0].closed = false;
subPath[0].entireSubPath = points;
doc.pathItems.add("", subPath);
}
Edit the function and put this in a .jsx file the for example drag and drop on Photoshop. This will make 2 paths in your Photoshop document that can then be stroked if you like one segmented, and one that guestimates curvature. Try other curves as well.