Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in RotateBy #5

Open
kondelik opened this issue Jun 12, 2024 · 0 comments
Open

Bug in RotateBy #5

kondelik opened this issue Jun 12, 2024 · 0 comments

Comments

@kondelik
Copy link

kondelik commented Jun 12, 2024

Hi, there is a bug in RotateBy (+ there again) function.

Currently, it is

var qx = (points[i].x - c.x) * mcos - (points[i].x - c.x) * msin + c.x
var qy = (points[i].x - c.x) * msin + (points[i].x - c.x) * mcos + c.x

but it should be

var qx = (points[i].x - c.x) * mcos - (points[i].y - c.y) * msin + c.x
var qy = (points[i].x - c.x) * msin + (points[i].y - c.y) * mcos + c.y

(.y instead of .x in second half)

implementation for example: https://depts.washington.edu/acelab/proj/dollar/dollar.js

Maybe thats the reason why RotateBy is commented out when building Unistroke? (or you need this to find difference between vertical and horizontal line?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant