Download the PHP package markbaker/complex without Composer

On this page you can find all versions of the php package markbaker/complex. 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 complex

PHPComplex


PHP Class Library for working with Complex numbers

Build Status Total Downloads Latest Stable Version License

Complex Numbers


The library currently provides the following operations:

together with functions for


Installation

Important BC Note

If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use MarkBaker/PHPComplexFunctions instead (available on packagist as markbaker/complex-functions).

You'll need to replace markbaker/complexin your composer.json file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Complex functions in the past, so no actual code changes are required.

You should not reference this library (markbaker/complex) in your composer.json, composer wil take care of that for you.

Usage

To create a new complex object, you can provide either the real, imaginary and suffix parts as individual values, or as an array of values passed passed to the constructor; or a string representing the value. e.g

or as an array

or as a string

Complex objects are immutable: whenever you call a method or pass a complex value to a function that returns a complex value, a new Complex object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Complex result).

Performing Mathematical Operations

To perform mathematical operations with Complex values, you can call the appropriate method against a complex value, passing other values as arguments

or use the static Operation methods

If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.

You can pass these arguments as Complex objects, or as an array, or string that will parse to a complex object.

Using functions

When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object

or use the static Functions methods

As with operations, you can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.

In the case of the pow() function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function

or pass the additional argument when calling the method


All versions of complex with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.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 markbaker/complex contains the following files

Loading the files please wait ....