How to detect location of a point relative to box rotation

Hey, I was wondering how I would detect the location of a point, either its the mouse, or the center of a colliding circle, relative to the rotation of box.

Currently, when I click the stage, a sensor circle is added. Then in the ADD collision method, I check to see if it's colliding with any boxes (they are all rectangular). If it is, then I will apply torque to the box depending on the center of the circle.

see attached image for a clearer representation of my idea

Any help would be appreciated, thanks.
I'm not sure what exactly you're trying to accomplish, but if it's to do with moving the box as a result of the sensor-shape, you might consider initially making the sensor an actual shape and then quickly into a sensor afterwards. That should set the boxes moving.

Just an idea. Hope you figure it out.
flash has methods localToGlobal and globalToLocal to help you translate a point into a relative point.

you may be looking for

import flash.geom.Point

var GPoint = CircleMC.localToGlobal(new Point(CircleMC.x, CircleMC.y));
var LPoint = BoxMC.globalToLocal(GPoint);

to test if your point is correct i might even suggest that you use a drawing method to draw on the BoxMC from its orgin to its relative(Localized) location of the point.

BoxMC.graphics.clear();
BoxMC.graphics.lineStyle();
BoxMC.graphics.moveTo(0,0);
BoxMC.graphics.lineTo(LPoint.x, LPoint.y);


this is about flash rather than about box2d. but still useful.
good luck.

Original thread: https://box2d.org/forum/viewtopic.php?t=4239