PHPackages                             stratevroman/polygon - 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. stratevroman/polygon

ActiveLibrary

stratevroman/polygon
====================

Polygon perimeter and point distance calculations

00PHP

Since Apr 8Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Polygon
=======

[](#polygon)

Вычисление периметра и расстояния между двумя любыми точками
------------------------------------------------------------

[](#вычисление-периметра-и-расстояния-между-двумя-любыми-точками)

Создадим объект класса Polygon

```
$points = [
    [0,1],
    [12,2],
    [13,99]
];
$polygon = new Polygon($points);

```

$points - точки (x,y) в виде массива(необязательный параметр)

### Метод getPerimeter рассчитывает периметр многоугольника

[](#метод-getperimeter-рассчитывает-периметр-многоугольника)

```
$polygon->getPerimeter();

```

### Метод getDistance(point1,point2) расчитывает расстояние между двумя точками(указываются индексы точек)

[](#метод-getdistancepoint1point2-расчитывает-расстояние-между-двумя-точкамиуказываются-индексы-точек)

```
$polygon->getDistance(0,1);

```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3130e9381fbaaecb071c532c73f017f1110159b3daf14da7645e18326aac9b3c?d=identicon)[stratevroman](/maintainers/stratevroman)

### Embed Badge

![Health badge](/badges/stratevroman-polygon/health.svg)

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

PHPackages © 2026

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