Download the PHP package marcoconsiglio/trigonometry without Composer

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

trigonometry

GitHub GitHub release (latest by date)


Mutation testing

MSI MCC CC MSI



A PHP support for angles and trigonometric functions.

Installation

composer require marcoconsiglio/trigonometry

Usage

Import this class to represent angles.

Import this class to sum angles.

Creating an angle

Degrees, minutes and seconds

This creates an angle from its values in degrees, minutes and seconds:

Parse a string

This creates an angle from its textual representation:

This is possible thank to the regular expression

The regex treat degrees and minutes as integer numbers, but seconds are treated as a float number.

Decimal

This create an angle from its decimal representation:

Radiant

This create an angle from its radiant representation:

Exceptions when creating an angle

Creating an angle by values overflowing the maximum (+/-)360° throws the AngleOverflowException

Creating an angle by string overflowing the maximum (+/-)360° throws the NoMatchException

Getting angle values

You can obtain degrees values separated in an array (simple by default, or associative):

There is read-only properties too:

You can cast the angle to decimal:

You can cast the angle to radiant:

Negative angles

You can create negative angles too!

Comparison

You can compare an angle with a numeric value, numeric string or another Angle object.

$\alpha > \beta$ (greater than)

$\alpha \ge \beta$ (greater than or equal)

$\alpha < \beta$ (less than)

$\alpha \le \beta$ (less than or equal)

Direction

Positive angle are represented by the class constant

while negative angle are represented by the opposite class constant:

You can toggle direction:

You can check if an angle is clockwise or counterclockwise.

Algebric sum between two angles

The Sum class extends the Angle class, so you immediately obtain the algebric sum between two angles, passing in its constructor a FromAngles builder, which is a SumBuilder.

Note that if the sum is more than +360° or less than -360°, the resulting angle will be corrected to remain between these limits.

Code documentation

UML Diagrams

You can find a class diagram at docs/classes.png. UML class diagram

phpDoc

You can read the code documentation at docs/index.html.


All versions of trigonometry with dependencies

PHP Build Version
Package Version
No informations.
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 marcoconsiglio/trigonometry contains the following files

Loading the files please wait ....