carlosjfc/geometric-shapes

PHP library for defining 2-dimensional geometric shapes and making basic calculations with them.

1.0.0 2017-01-09 17:31 UTC

This package is auto-updated.

Last update: 2025-04-25 08:56:52 UTC


README

This is a simple Object Oriented PHP library for defining 2-dimensional geometric shapes and making basic calculations with them. The following shapes are Implemented:

  • Circle
  • Triangle
  • Right Triangle
  • Equilateral Triangle
  • Parallelogram
  • Rectangle
  • Square

For each shape, the library is able to do the following:

  • calculate the area.
  • calculate the perimeter.
  • proportionally resize the shape up or down, given a floating-point scale factor scale.

This library is also a PSR-4 package. You can find it on Packagist (https://packagist.org) under the name and include it with composer.

If you want to be a contributor you can clone the repository and open a new branch to implement changes. When ready create a PR (Pull Request), then once is approve you can merge in the development branch.

Continuous integration is used to make builds, so we warranty that your new contributions doesn't brake the source code. We ask you as a contributor to follow PSR-4 standard, don't change the current test cases, whoever we encourage you to implement test cases for each new functionality that you implement.