PHPackages                             huzhihao/sat - 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. huzhihao/sat

ActiveLibrary

huzhihao/sat
============

A library performing collision detection of simple 2D shapes with Separating Axis Theorem.

01231PHP

Since Mar 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/whahuzhihao/SAT)[ Packagist](https://packagist.org/packages/huzhihao/sat)[ RSS](/packages/huzhihao-sat/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SAT
===

[](#sat)

A library performing collision detection of simple 2D shapes with Separating Axis Theorem.

Simply translated from a [Javascript library](https://github.com/jriecken/sat-js) and reconstructed into a PHP version.

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

[](#requirements)

- PHP version 5.3.0 or higher

Installation
------------

[](#installation)

`composer require huzhihao/sat:dev-master` and then require the Composer autoloader from your code.

Usage
-----

[](#usage)

Here are the examples to show how SAT works. To check whether two shapes collide, you can use `SAT\Collision::XXX` functions. And a `Response` object will be given to check whether one shape is completely covered by the other.

```
