Skip to content

Commit

Permalink
added auto-generated min version
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoren committed Nov 28, 2018
1 parent f294f99 commit 7cf73ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ function draw() {

#### collidePointEllipse()
###### collidePointEllipse(pointX, pointY, ellipseX, ellipseY, ellipseWidth, ellipseHeight )
point ellipse collision, it takes the point, the centre of the ellipse, the major and the minor axes (diameters).
point ellipse collision. It takes the point, the centre of the ellipse, the major and the minor axes (diameters).

![point ellipse collision](https://user-images.githubusercontent.com/13430702/47784680-98543d80-dd06-11e8-8814-47a37186263a.png)

![point ellipse collision](https://user-images.githubusercontent.com/13430702/47784680-98543d80-dd06-11e8-8814-47a37186263a.png
)
```javascript
let hit = false;
function draw(){
Expand Down
7 changes: 4 additions & 3 deletions p5.collide2d.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
Repo: https://github.com/bmoren/p5.collide2D/
Created by http://benmoren.com
Some functions and code modified version from http://www.jeffreythompson.org/collision-detection
GNU LGPL 2.1 License
Version 0.1 | January 10th, 2016
Version 0.6 | Nov 28th, 2018
CC BY-NC-SA 4.0
*/
console.log("### p5.collide ###")

Expand Down Expand Up @@ -71,7 +72,7 @@ p5.prototype.collidePointEllipse = function (x, y, cx, cy, dx, dy) {
// Discarding the points outside the bounding box
if (x > cx + rx || x < cx - rx ||y > cy + ry || y < cy - ry) {
return false;
}
}
// Compare the point to its equivalent on the ellipse
var xx = x - cx, yy = y - cy;
var eyy = ry * this.sqrt(this.abs(rx * rx - xx * xx)) / rx;
Expand Down
9 changes: 9 additions & 0 deletions p5.collide2d.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7cf73ec

Please sign in to comment.