[Math]Smooth movement with rotation matrix

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi,
    I have a math problem with a rotation.
    I have an array of point and I want to make a rotation of all points, this is my code:

    Code
    RelativeXPos = item.x - X0;RelativeYPos = item.y - Y0;
    resultX = (cos(rad)*RelativeXPos) + (-sin(rad)*RelativeYPos) + X0;
    resultY = (sin(rad)*RelativeXPos) + (cos(rad)*RelativeYPos) + Y0;

    item is my point object, X0 and Y0 is the center of the rotation, I use a matrix calcul for find the coordinates.
    But the coordinates must be an integer and I try the 3 functions: round(), ceil() and floor(), I have always a non-smooth movement when I attach an active to each points of my extension.

    Do you have any answer of my problem ?
    Thanks.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!