Skip to content

Commit

Permalink
command rename, docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteBlackGoose committed Nov 15, 2022
1 parent a94e531 commit ac99510
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
21 changes: 17 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

using AngouriMath;
using AngouriMath.Extensions;
using HonkSharp;
using HonkSharp.Functional;

var cliArgs = System.Environment.GetCommandLineArgs();
var reader = new ArgReader(cliArgs);
Expand Down Expand Up @@ -74,12 +76,23 @@ amcli diff - to differentiate the expression over the given variable
$ echo "1 + x^2" | amcli diff "x"
2 * x

SIMPLIFY
SIMP

amcli simplify - to simplify the expression. Expects one argument.
amcli simp - to simplify the expression. Expects one argument.

Example:
$ amcli simplify "sin(x)^2 + cos(x)^2"
$ amcli simp "sin(x)^2 + cos(x)^2"
1

FSIMP

amcli fsimp - to simplify the expression "faster". This one works
closer to eval than to simp, but unlike eval, it won't try to
collapse to a single number or boolean (e. g. sqrt(3) will stay as
it is). Expects one argument.

Example:
$ amcli fsimp "sin(x)^2 + cos(x)^2"
1

SOLVE
Expand Down Expand Up @@ -198,7 +211,7 @@ Here the result of `echo` is substituted instead of the second argument
Console.WriteLine(expr.Latexise());
break;

case "simplify":
case "simp":
expr = reader.Next().ToEntity();
Console.WriteLine(expr.Simplify());
break;
Expand Down
17 changes: 14 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,23 @@ COMMANDS
$ echo "1 + x^2" | amcli diff "x"
2 * x

SIMPLIFY
SIMP

amcli simplify - to simplify the expression. Expects one argument.
amcli simp - to simplify the expression. Expects one argument.

Example:
$ amcli simplify "sin(x)^2 + cos(x)^2"
$ amcli simp "sin(x)^2 + cos(x)^2"
1

FSIMP

amcli fsimp - to simplify the expression "faster". This one works
closer to eval than to simp, but unlike eval, it won't try to
collapse to a single number or boolean (e. g. sqrt(3) will stay as
it is). Expects one argument.

Example:
$ amcli fsimp "sin(x)^2 + cos(x)^2"
1

SOLVE
Expand Down

0 comments on commit ac99510

Please sign in to comment.