Skip to content

Commit

Permalink
-New predefined derivatives: acos, asin, atan
Browse files Browse the repository at this point in the history
-New package2.xml file


git-svn-id: http://svn.php.net/repository/pear/packages/Math_Derivative/trunk@223551 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
colder committed Nov 18, 2006
1 parent da495b9 commit 59e9cbd
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 37 deletions.
22 changes: 13 additions & 9 deletions Derivative.php
Expand Up @@ -7,17 +7,17 @@
* *
* PHP version 4 and 5 * PHP version 4 and 5
* *
* LICENSE: This source file is subject to version 3.0 of the PHP license * LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI: * that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of * http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please * the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately. * send a note to license@php.net so we can mail you a copy immediately.
* *
* @category Math * @category Math
* @package Math_Derivative * @package Math_Derivative
* @author Etienne Kneuss <colder@php.net> * @author Etienne Kneuss <colder@php.net>
* @copyright 1997-2005 The PHP Group * @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0 * @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$ * @version CVS: $Id$
* @link http://pear.php.net/package/Math_Derivative * @link http://pear.php.net/package/Math_Derivative
*/ */
Expand Down Expand Up @@ -98,12 +98,16 @@ class Math_Derivative {
* @var array * @var array
* @access protected * @access protected
*/ */
var $_registeredFunctions = array('sin' => 'cos(arg)*d(arg)', var $_registeredFunctions = array('sin' => 'cos(arg)*d(arg)',
'cos' => '-sin(arg)*d(arg)', 'cos' => '-sin(arg)*d(arg)',
'tan' => '1/cos(arg)^2*d(arg)', 'tan' => '1/cos(arg)^2*d(arg)',
'ln' => 'd(arg)/(arg)', 'ln' => 'd(arg)/(arg)',
'log' => 'd(arg)/(arg)', 'log' => 'd(arg)/(arg)',
'e' => 'd(arg)*e(arg)'); 'e' => 'd(arg)*e(arg)',
'sqrt' => 'd((arg)^(1/2))',
'acos' => '-1/((1-(arg)^2)^(1/2))',
'asin' => '1/((1-(arg)^2)^(1/2))',
'atan' => '1/(1+(arg)^2)');


// }}} // }}}
// {{{ setVariableName([(string) $value]) // {{{ setVariableName([(string) $value])
Expand Down
70 changes: 42 additions & 28 deletions package.xml
@@ -1,31 +1,45 @@
<?xml version="1.0" encoding="ISO-8859-1" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0"> <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
<package version="1.0"> <package version="1.0" packagerversion="1.4.6">
<name>Math_Derivative</name> <name>Math_Derivative</name>
<summary>Calculate the derivative of a mathematical expression</summary> <summary>Calculate the derivative of a mathematical expression</summary>
<description>This class allows you to calculate the derivative of an expression stored in a string.</description> <description>This package allows you to calculate the derivative of an expression stored in a string.
<maintainers> </description>
<maintainer> <maintainers>
<user>colder</user> <maintainer>
<name>Etienne Kneuss</name> <user>colder</user>
<email>colder@php.net</email> <name>Etienne Kneuss</name>
<role>lead</role> <email>colder@php.net</email>
</maintainer> <role>lead</role>
</maintainer>
</maintainers> </maintainers>
<release> <release>
<version>0.1</version> <version>0.1.0</version>
<date>2006-02-15</date> <date>2006-11-18</date>
<license>PHP License</license> <license>PHP License 3.01</license>
<state>alpha</state> <state>beta</state>
<filelist> <notes>
<file role="php" baseinstalldir="Math" name="Derivative.php"/> Beta release after 8 months of tests.
</filelist> Included predefined functions like sqrt(), atan(), acos(), asin().
</release> </notes>
<changelog> <provides type="class" name="Math_Derivative" />
<release> <provides type="function" name="Math_Derivative::setVariableName" />
<version>0.1</version> <provides type="function" name="Math_Derivative::useCache" />
<date>2006-02-15</date> <provides type="function" name="Math_Derivative::resetCache" />
<notes>First version</notes> <provides type="function" name="Math_Derivative::getCache" />
</release> <provides type="function" name="Math_Derivative::getDerivative" />
</changelog> <provides type="function" name="Math_Derivative::cleanExpression" />
<provides type="function" name="Math_Derivative::parse" />
<provides type="function" name="Math_Derivative::reliesOndx" />
<provides type="function" name="Math_Derivative::ruleAddition" />
<provides type="function" name="Math_Derivative::ruleMultiplication" />
<provides type="function" name="Math_Derivative::ruleDivision" />
<provides type="function" name="Math_Derivative::rulePower" />
<provides type="function" name="Math_Derivative::registerFunction" />
<provides type="function" name="Math_Derivative::getDerivativeCallback" />
<provides type="function" name="Math_Derivative::ruleTerm" />
<filelist>
<file role="php" baseinstalldir="Math" md5sum="7f333d07caf0d4f9160c03c08e7ba4b1" name="Derivative.php"/>
</filelist>
</release>
</package> </package>
48 changes: 48 additions & 0 deletions package2.xml
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd">
<name>Math_Derivative</name>
<channel>pear.php.net</channel>
<summary>Calculate the derivative of a mathematical expression</summary>
<description>This package allows you to calculate the derivative of an expression stored in a string.

</description>
<lead>
<name>Etienne Kneuss</name>
<user>colder</user>
<email>colder@php.net</email>
<active>yes</active>
</lead>
<date>2006-11-18</date>
<time>15:58:17</time>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license>PHP License 3.01</license>
<notes>Beta release after 8 months of tests.
Included predefined functions like sqrt(), atan(), acos(), asin().
</notes>
<contents>
<dir name="/">
<file baseinstalldir="Math" md5sum="7f333d07caf0d4f9160c03c08e7ba4b1" name="Derivative.php" role="php" />
</dir> <!-- / -->
</contents>
<dependencies>
<required>
<php>
<min>4.0.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
</package>

0 comments on commit 59e9cbd

Please sign in to comment.