Download the PHP package irrevion/science without Composer
On this page you can find all versions of the php package irrevion/science. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download irrevion/science
More information about irrevion/science
Files in irrevion/science
Package science
Short Description PHP library for extended mathematical operations
License MIT
Homepage https://github.com/irrevion/science/
Informations about the package science
science
PHP library for extended mathematical operations. Its mostly focused on operations with Complex numbers, Quaternions and Linear Algebra.
Key features and advantages
- Improved
Math::pow($base, $exponent)
function, able to raise any real or complex number to any real or complex exponent - Support for SymPy )
- Physics units conversion (more units to be added...) using
(new Quantity(0.7, IAU::parsec))->convert(SI::metre)
Installation
Library is available on Packagist and could be installed using CLI command:
Usage
If installed via composer include composer generated autoloader and add use irrevion\science\Math\Math
statement for example.
If you are not using composer or using a custom folder you can modify and include custom autoloader.
Example:
Examples
Scalar is a basic number class:
Basic arithmetic operations available:
As mentioned above, significant enhancement of pow() function has been made:
It is also possible to get all roots of a number
So, as you can see, the following operations are supported:
- raise of real number to a real power
- raise of real number to a fractional power (2/3 means cubic root squared)
- raise of negative number to a rational or real power (1/n is n-th root of a number)
- raise of an any number to negative power (rational or real)
- raise of a number to imaginary or complex power
- raise of an any available value (entity-type instance: mixed/numeric, Scalar, Fraction, Imaginary, Complex, ComplexPolar, QuaternionComponent, Quaternion, Vector, etc) at least to positive integer power
Versions history
~dev-main
- Symbolic math implementation started
- Physics: Added Rydberg energy, kilometre, attometre, angstrom and Bohr radius units
v0.0.5
- Matrix inversion implemented (as well as methods for finding cofactor matrix, adjugate, minors, row echelon form, reduced REF, rank)
- Complex power, exponentiation, natural logarythm implemented
- Quaternions added
- Physics: Added units Dalton, Apostilb, Planck energy
v0.0.4
- Vector checking methods added (orthogonal, collinear, coplarar)
- Angle between vectors calculation added
- Physics: Angle units added
v0.0.3
- Matrix determinant implemented
- Physics: New units added (Ohm, Farad, Watt, etc)
v0.0.2
- Added units in physics
- Fixed fallback autoloader
- Implemented search by unit entity in physical unit categories
v0.0.1
- Basic entities implemented
- Composer requirements are met
Documentation
- Math
- Numbers, Entities & Matrices
- NaN
- Scalar
- Fraction
- Imaginary
- Complex
- ComplexPolar
- QuaternionComponent
- Quaternion
- Vector
- Matrix
- Symbolic Math
- Symbols
- Operations
- Expressions
- Numbers, Entities & Matrices
- Physics
- Quantity
- Helpers
- Utils - miscellaneous functions toolbox
- Delegator - type manager and delegator
- R - array-like object constructor
- M - 2-dimensional R