|
|
|
@ -1,20 +1,29 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2014 Apocalypse Laboratories.
|
|
|
|
|
* Apocalypse Laboratories
|
|
|
|
|
* Open Source License
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
* Source code can be used for any purpose, as long as:
|
|
|
|
|
* - Compiled binaries are rebranded and trademarks are not
|
|
|
|
|
* visible by the end user at any time, except to give
|
|
|
|
|
* credit to Apocalypse Laboratories, such as by showing
|
|
|
|
|
* "Based on <product> by Apocalypse Laboratories" or a
|
|
|
|
|
* similar notice;
|
|
|
|
|
* - You do not use the code for evil;
|
|
|
|
|
* - Rebranded compiled applications have significant
|
|
|
|
|
* differences in functionality;
|
|
|
|
|
* - and you provide your modified source code for download,
|
|
|
|
|
* under the terms of the GNU LGPL v3 or a comparable
|
|
|
|
|
* license.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
|
* MA 02110-1301 USA
|
|
|
|
|
* Compiled binaries cannot be redistributed or mirrored,
|
|
|
|
|
* unless:
|
|
|
|
|
* - You have written permission from Apocalypse Laboratories;
|
|
|
|
|
* - Downloads are not available from Apocalypse Laboratories,
|
|
|
|
|
* not even behind a paywall or other blocking mechanism;
|
|
|
|
|
* - or you have received a multi-computer license, in which
|
|
|
|
|
* case you should take measures to prevent unauthorized
|
|
|
|
|
* downloads, such as preventing download access from the
|
|
|
|
|
* Internet.
|
|
|
|
|
*/
|
|
|
|
|
package net.apocalypselabs.symat;
|
|
|
|
|
|
|
|
|
@ -60,6 +69,12 @@ public class Functions {
|
|
|
|
|
return util.evaluate(input).toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Shortcut for non-JS math evaluation.
|
|
|
|
|
public String $(String input) {
|
|
|
|
|
return sym(input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String replace(String function, String variable, String newvar) {
|
|
|
|
|
return function.replaceAll(variable, newvar);
|
|
|
|
|
}
|
|
|
|
|