Math::Giac - A perl interface to giac, a CAS(Computer Algebra System)
Version 0.0.1
use Math::Giac; my $giac; eval( { $giac=$Math::Giac->new; } ); if ( $@ ){ die("Failed to locate the giac binary"); } my $results=$giac->run('sin(x)+cos(pi)-3'); print $results."\n"; $results=$giac->run('mathml(sin(x)+cos(pi)-3)'); print $results."\n"; $giac->set_vars({ A=>2 }); my $results=$giac->run('sin(A)+cos(pi)-3');
This initiates the object.
This also checks to make sure that giac is in the path. If that check fails, it will die.
my $giac; eval( { $giac=$Math::Giac->new; } ); if ( $@ ){ die("Failed to locate the giac binary"); }
This returns the respected string after putting together a variable list.
The final output is what is returned, or $output[ $#output - 1 ], assuming it is a single line one. Otherwise it works backwards to find a match.
This will remove the " from the start and return of the return, which gets added for with latex or mathml.
This will die on a non-zero exit or no string being specified.
my $results=$giac->run('sin(x)+cos(pi)-3'); print $results."\n"; $results=$giac->run('mathml(sin(x)+cos(pi)-3)'); print $results."\n";
Removes any set variables.
As long as new was successfully called, this won't error.
$giac->vars_clear;
Sets the variables.
xsThis requires one argument, which is a hash reference.
Lets say the variable hash below is passed.
{ A=>1, B=>3, }
Then the resulting code will be as below.
A:=1 B:=3
Then requested item to run is then added to the end. So if we are running 'sin(pi)+A' then we will have the item below.
A:=1 B:=3 sin(pi)+A
Zane C. Bowers-HAdley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-math-giac at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Math-Giac. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-math-giac at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Math::Giac
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-Giac
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Math-Giac
CPAN Ratings
https://cpanratings.perl.org/d/Math-Giac
Search CPAN
https://metacpan.org/release/Math-Giac
Repository
https://gitea.eesdp.org/vvelox/Math-Giac
This software is Copyright (c) 2020 by Zane C. Bowers-HAdley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Math::Giac, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Giac
CPAN shell
perl -MCPAN -e shell install Math::Giac
For more information on module installation, please visit the detailed CPAN module installation guide.