ID:2467325
 
Code:
C.transform = turn(C.transform,10)


So I'm trying to find a way to find the value for this particular object.

Each time this is run, it applies a 10 degree rotation on the subject. Is there then a way I can go about returning the value the subject has been rotated by?

If, for example, this was applied 5 times, is there a way to return that 50 value without creating a separate var to track the number of times this transform has been applied?
The 2D rotation matrix has the sin() and cos() of the rotation angle in its components. You can plug those into atan2() to get an angle.

However, it's probably not necessary to get the angle. Depending on how you intend to use the angle, you may not need the angle at all. For instance, if you wanted to rotate something else by the same amount, you could just set their transform to this same transform.
In response to Kaiochao
Kaiochao wrote:
The 2D rotation matrix has the sin() and cos() of the rotation angle in its components. You can plug those into atan2() to get an angle.

However, it's probably not necessary to get the angle. Depending on how you intend to use the angle, you may not need the angle at all. For instance, if you wanted to rotate something else by the same amount, you could just set their transform to this same transform.


Hmm, I suppose that would work. I dont think I need it for anything other than matching the angle.