I need to detect collisions in my HTML5 canvas (I'm using the KineticJS library), and thus far have used my own methods to detect if a certain point is within a certain shape.

I recently noticed that there's a method from the Container class, getIntersections(point) which should do exactly what I want. However it seems to be EXTREMELY slow, so when moving an object on the canvas and using the method for every new position, it becomes unusable.

Has anyone used this method for collision detection? If not, are there any tips on collision detection in a HTML5 canvas? I'm having trouble detecting if a point is inside a rectangle that is rotated by a certain amount of degrees.