diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java
index d916a99..f6b3171 100644
--- a/src/net/apocalypselabs/symat/Functions.java
+++ b/src/net/apocalypselabs/symat/Functions.java
@@ -27,6 +27,7 @@
*/
package net.apocalypselabs.symat;
+import static java.lang.Math.*;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.swing.JOptionPane;
@@ -65,21 +66,17 @@ public class Functions {
public String D(String function, String idv) {
return util.evaluate("diff(" + function + "," + idv + ")").toString();
}
-
- public double cos(Object expression) {
- return Double.parseDouble(util.evaluate("Cos("+expression+")").toString());
- }
-
- public double sin(Object expression) {
- return Double.parseDouble(util.evaluate("Sin("+expression+")").toString());
+
+ public String factor(String function) {
+ return sym("Factor(" + function + ")");
}
- public double tan(Object expression) {
- return Double.parseDouble(util.evaluate("Tan("+expression+")").toString());
+ public double rad(double degrees) {
+ return degrees * (PI/180);
}
- public String factor(String function) {
- return sym("Factor(" + function + ")");
+ public double deg(double radians) {
+ return radians * (180/PI);
}
public String sym(String input) {
diff --git a/src/net/apocalypselabs/symat/help/commands.html b/src/net/apocalypselabs/symat/help/commands.html
index 0ee37c3..5e5bc37 100644
--- a/src/net/apocalypselabs/symat/help/commands.html
+++ b/src/net/apocalypselabs/symat/help/commands.html
@@ -24,7 +24,8 @@
plotscale({-1,0,1,2,3}) Scale the graph. Erases content when scaled.
Smaller is farther out, larger closer.
drawDot(x,y) Draw a small red dot wherever you tell it.
-
+
rad(degrees), deg(radians) Convert degrees to radians and vice versa.
+ Python has built-in radians(degrees) and degrees(radians) which work the same.
You can open a graph window with its button. - You can also start it with s function to graph with - the command plot("sin[x]") or whatever.
-Pretty much, if you want to graph "y=32*x", enter "32*x".
-Protip: You can save your cool graphs as a - picture without using a camera, check it out!
+You can open a standalone graph window from the ribbon bar. + You can also use a graph from a script or shell, for example, + the command plot("sin[x]").
+To graph a function, it must be in the form y=(something x). + Only input the right-hand side of the equation.
+Tip: You can export graphs as images for presentations and the like.