Add degree/radians conversion functions and manual entries, and clean up other entries.
This commit is contained in:
parent
15b70aa227
commit
2815d6d797
@ -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,22 +66,18 @@ 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 double tan(Object expression) {
|
||||
return Double.parseDouble(util.evaluate("Tan("+expression+")").toString());
|
||||
}
|
||||
|
||||
|
||||
public String factor(String function) {
|
||||
return sym("Factor(" + function + ")");
|
||||
}
|
||||
|
||||
public double rad(double degrees) {
|
||||
return degrees * (PI/180);
|
||||
}
|
||||
|
||||
public double deg(double radians) {
|
||||
return radians * (180/PI);
|
||||
}
|
||||
|
||||
public String sym(String input) {
|
||||
return util.evaluate(input).toString();
|
||||
|
@ -24,7 +24,8 @@
|
||||
<br><b>plotscale({-1,0,1,2,3})</b> Scale the graph. Erases content when scaled.
|
||||
Smaller is farther out, larger closer.
|
||||
<br><b>drawDot(x,y)</b> Draw a small red dot wherever you tell it.
|
||||
<br><b></b>
|
||||
<br><b>rad(degrees), deg(radians)</b> Convert degrees to radians and vice versa.
|
||||
Python has built-in radians(degrees) and degrees(radians) which work the same.
|
||||
<br><b></b>
|
||||
<br><b></b>
|
||||
</p>
|
||||
|
@ -4,11 +4,11 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Graphing</h1>
|
||||
<p>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.</p>
|
||||
<p>Pretty much, if you want to graph "y=32*x", enter "32*x".</p>
|
||||
<p><i>Protip: You can save your cool graphs as a
|
||||
picture without using a camera, check it out!</i></p>
|
||||
<p>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]").</p>
|
||||
<p>To graph a function, it must be in the form y=(something x).
|
||||
Only input the right-hand side of the equation.</p>
|
||||
<p><i>Tip: You can export graphs as images for presentations and the like.</i></p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,12 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to SyMAT!</h1>
|
||||
<p>SyMAT is a Java-based algebra and calculus system.
|
||||
Scripts and commands can be written in JavaScript or Python.</p>
|
||||
<p><b>Copyright:</b><br>
|
||||
SyMAT is copyright © 2014 Apocalypse Laboratories. See Licenses for more information.</p>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user