qt-rectangle.js

total 0
used 0
limit 0
class Rectangle { constructor(x, y, w, h) { this.x = x; this.y = y; this.w = w; this.h = h; } contains(point) { return ( (point.x >= (this.x - this.w)) && (point.x < (this.x + this.w)) && (point.y >= (this.y - this.h)) && (point.y < (this.y + this.h)) ); } insersects(range) { return !( range.x - range.w > this.x + this.w || range.x + range.w < this.x - this.w || range.y - range.h > this.y + this.h || range.y + range.h < this.y - this.h ); } }
Run
Meta Data
filepath_exists True
path qt-rectangle.js
filepath qt-rectangle.js
clean_files ()
markdown {'html': '', 'content': ''}