PHPackages                             phpmath/vector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpmath/vector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpmath/vector
==============

A PHP library to work with vectors.

1.0.0(10y ago)337MITPHPPHP &gt;=5.3.3

Since Apr 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/phpmath/vector)[ Packagist](https://packagist.org/packages/phpmath/vector)[ RSS](/packages/phpmath-vector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

vector
======

[](#vector)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c73f6649f7fc5eb478be38981e8990eb9486ecc59402de79c29c94dca77d8716/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706d6174682f766563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpmath/vector)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c780cc9afde2feeb954bbc484541f5f9e33f0322bdfbe5ca11659ac4db680348/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068706d6174682f766563746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/phpmath/vector)[![Coverage Status](https://camo.githubusercontent.com/168cc850b033fb826d3f33778e6ef03803e9ad42807387bf4a3a66efa9926ef0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7068706d6174682f766563746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpmath/vector/code-structure)[![Quality Score](https://camo.githubusercontent.com/2e1353862dc1dc94f2e6911dd73e4e7f0d88f6f84eace29d041905e62e28fa51/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7068706d6174682f766563746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpmath/vector)[![Total Downloads](https://camo.githubusercontent.com/fb1d3ddb59d1e0102c3fbda66ac801dc782c55dbf9f4401494f8d857221ef1eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706d6174682f766563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpmath/vector)[![SensioLabsInsight](https://camo.githubusercontent.com/8bb53219ac4e0e52e0f7bc28dab7c9f6a9ab55bf604dddfa22e72653edeac92e/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f35343365363030392d343965652d343233392d393163342d3938356366646433326435302e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/543e6009-49ee-4239-91c4-985cfdd32d50)

A PHP library to work with mathematical vectors.

Getting started
---------------

[](#getting-started)

It's recommended to install this library via [Composer](https://getcomposer.org).

```
{
    "require": {
        "phpmath/vector": "^2.0"
    }
}
```

The current master branch is considered stable. The badges on top of this document should confirm this.

Requirements
------------

[](#requirements)

This library runs on PHP 5.5, PHP 5.6, PHP 7 and HHVM. This library depends on phpmath/bignumber which itself depends on the GMP extension.

Features
--------

[](#features)

This library supports the following operations:

- Fully unit tested.
- Basic classes such as Tuple, Vector, Vector2 and Vector3.
- Basic operations such as adding, scaling and subtracting.
- Performing dotProduct and crossProduct operations.
- Normalization
- Conjugate (negate - reverse)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3682d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ee7f711ef4d45ada0ac92c7ab2f548055a7cfbe718da6c4bbb81b2f6693c528?d=identicon)[waltertamboer](/maintainers/waltertamboer)

---

Top Contributors

[![waltertamboer](https://avatars.githubusercontent.com/u/508054?v=4)](https://github.com/waltertamboer "waltertamboer (17 commits)")[![oliworx](https://avatars.githubusercontent.com/u/1712684?v=4)](https://github.com/oliworx "oliworx (2 commits)")

---

Tags

vectormath

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpmath-vector/health.svg)

```
[![Health](https://phpackages.com/badges/phpmath-vector/health.svg)](https://phpackages.com/packages/phpmath-vector)
```

###  Alternatives

[brick/math

Arbitrary-precision arithmetic library

2.1k504.0M277](/packages/brick-math)[markbaker/matrix

PHP Class for working with matrices

1.5k279.7M38](/packages/markbaker-matrix)[markrogoyski/math-php

Math Library for PHP. Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra

2.4k7.1M40](/packages/markrogoyski-math-php)[rubix/tensor

A library and extension that provides objects for scientific computing in PHP.

2751.4M5](/packages/rubix-tensor)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[jlawrence/eos

Parse and solve math equations without using 'eval()'.

1071.1M11](/packages/jlawrence-eos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
