Download the PHP package malenki/math without Composer

On this page you can find all versions of the php package malenki/math. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package math

Math

Build Status

Library to deal with some mathematical stuff.

Implemented or partially implemented mathematical concepts are: Complex number, Matrix, Normal distribution, Random, Angle, Random Complex, Descriptive Statistics, Parametric tests (Anova, Dependant t-Test) and Non-Parametric tests (Wilcoxon Signed-rank test, Wilcoxon-Mann-Whitney test, Kruskal-Wallis).

Install

You can get this lib by downloading the ZIP archive, cloning this repository or using Composer with the following code to put into your composer.json file:

Angle

You can use angles as deg, gon, rad or turn. By default, radians is used.

You can get DMS style too:

You can test whether current angle is right, straight or perigon:

You can test current angle with another to know is they are complementary or supplementary:

Matrix

Creating matrix is simple, first step, you instanciate it with column numbers and row numbers, second step, you put data into it.

Getting data is not difficult too. You can get matrice’s size, content for a row or a column, all data and even a dump as a string.

Getting matrix transpose is as simple as that:

OK, you can get, you can set… but you can do more complicated things.

You can multiply matrix with another one, but beware of compatibility!

You can multiply matrix with a scalar too, or a complex number:

Addition is possible too, you must test before if size of each matrix is the same, or catch exception.

Getting determinant of a square matrix is easy, just do the following:

If you try to get determinant for a non square matrix, you get an Exception.

Inverse of square matrix is simple too, and like you can imagine, it is like that:

The cofactor matrix, used be previous method, is compute with that:

Complex

Using complex is like a child game: instanciate it with real part and imaginary part. That’s all!

But you can create complex number using rho and theta values, theta can be simple float or Angle object:

Complex number object acts like string too, remembering its original form:

You have some magic getters:

You can do addition, multiplication:

Getting negative, conjugate and inverse is simple too:

Normal distribution

You can play with graph for given mean and standard deviation, or you can generate fake samples.

Some examples to understand:

Factorial

You can get factorial of one integer, it is very easy to use, instanciate it with n rank and then get value by calling result attribute.

String context is available too:

Random

You can play with random numbers, included into integer range or as float between 0 and 1.

You can take one:

You can take many:

You can take many without replacement:

Random Complex Number

This class allows you to get one or many complex numbers with real and imaginary or rho and theta inside given range.

So, to get one complex number with its real part into [2, 6.5] range and its imaginary part into [-2, 5] range, you must do that:

You can do that with trigonometric form too, but now with 10 generated items:

Descriptive Statistics

You can do a lot of stats about data, like mean, variance, standard deviation, kurtosis, etc.

You can put all values at once while instanciating:

You can add others data after too:

Counting values is as easy to use count():

Many means are avaialble too:

Variance, population or sample are available with standard deviation too:

Quartiles and median:

Getting mode(s):

Frequencies, relative frequencies and cumulative frequencies:

Kurtosis and its tests are available:

Parametric Tests

Anova

One example is better than long blahblah:

Dependant t-Test

Non Parametric Tests

Wilcoxon Signed-Ranks Test

TODO

Dev in progress, more informations soon here on into source code!

MIT Open Source License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of math with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package malenki/math contains the following files

Loading the files please wait ....