The PHP Shapes Library provides a library and an interface for shapes such as:
- Circle
- Right Triangle
- Equilateral Triangle
- Rectangle
- Square
- Parallelogram
A Demo of code: (by running php demo.php)
Each of these shapes provides:
- getArea() for calculating Area
- getPerimeter() for calculating Perimeter
- resize($percentage) for resizing
- Getters for getting base / height / radius / side (whichever one is applicable depending on shape)
- Setters for setting base / height / radius / side (whichever one is applicable depending on shape)
Additionally, there is a shapeInterface that governs the required method that needs to be implemented if new shape are added
- Clone this branch
- Clone this branch
- CD into root
- run
php demo.php
