|
|
|
@ -58,7 +58,6 @@ public class Functions {
|
|
|
|
|
/*
|
|
|
|
|
Math commands
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Derivative of function with respect to idv
|
|
|
|
|
public String diff(String function, String idv) {
|
|
|
|
|
return util.evaluate("diff(" + function + "," + idv + ")").toString();
|
|
|
|
@ -87,11 +86,11 @@ public class Functions {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double rad(double degrees) {
|
|
|
|
|
return degrees * (PI/180);
|
|
|
|
|
return degrees * (PI / 180);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double deg(double radians) {
|
|
|
|
|
return radians * (180/PI);
|
|
|
|
|
return radians * (180 / PI);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String sym(String input) {
|
|
|
|
@ -122,7 +121,6 @@ public class Functions {
|
|
|
|
|
/*
|
|
|
|
|
Graphing interfaces
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public void plotrange(double xmin, double xmax) {
|
|
|
|
|
graphwin.setRange(xmin, xmax);
|
|
|
|
|
}
|
|
|
|
@ -132,6 +130,14 @@ public class Functions {
|
|
|
|
|
graphwin.graphFunction(function);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void plot(double[] x, double[] y) {
|
|
|
|
|
graphwin.plotPoints(x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void plot(double[] x, double[] y, String name) {
|
|
|
|
|
graphwin.plotPoints(x, y, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void plot(String function, double xmin, double xmax) {
|
|
|
|
|
graphwin.setRange(xmin, xmax);
|
|
|
|
|
plot(function);
|
|
|
|
@ -199,6 +205,7 @@ public class Functions {
|
|
|
|
|
/*
|
|
|
|
|
Constructor.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public Functions() {
|
|
|
|
|
MainGUI.loadFrame(graphwin, false);
|
|
|
|
|
}
|
|
|
|
|