Skip to content

Bug in RotateBy #5

@kondelik

Description

@kondelik

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions