{"action":"created","issue":{"url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/84","repository_url":"https://api.github.com/repos/romannurik/AndroidIconAnimator","labels_url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/84/comments","events_url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/84/events","html_url":"https://github.com/romannurik/AndroidIconAnimator/issues/84","id":196237360,"number":84,"title":"Investigate possible bug in svgpathdata.js (transformPoint_ function)","user":{"login":"alexjlockwood","id":1380747,"avatar_url":"https://avatars.githubusercontent.com/u/1380747?v=3","gravatar_id":"","url":"https://api.github.com/users/alexjlockwood","html_url":"https://github.com/alexjlockwood","followers_url":"https://api.github.com/users/alexjlockwood/followers","following_url":"https://api.github.com/users/alexjlockwood/following{/other_user}","gists_url":"https://api.github.com/users/alexjlockwood/gists{/gist_id}","starred_url":"https://api.github.com/users/alexjlockwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexjlockwood/subscriptions","organizations_url":"https://api.github.com/users/alexjlockwood/orgs","repos_url":"https://api.github.com/users/alexjlockwood/repos","events_url":"https://api.github.com/users/alexjlockwood/events{/privacy}","received_events_url":"https://api.github.com/users/alexjlockwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-17T19:03:20Z","updated_at":"2016-12-17T19:44:33Z","closed_at":null,"body":"There is a function called `transformPoint_` in `svgpathdata.js` that is declared as follows:\r\n\r\n```\r\nfunction transformPoint_(p, transformMatricies) {\r\n  return transformMatricies.reduce((p, transform) => {\r\n    const m = transform.matrix;\r\n    return {\r\n      // dot product\r\n      x: m.a * p.x + m.c * p.y + m.e * 1,\r\n      y: m.b * p.x + m.d * p.y + m.f * 1,\r\n    };\r\n  }, p);\r\n}\r\n```\r\n\r\nThis function basically applies a set of transform matrices using matrix multiplication.\r\n\r\nHowever, I didn't quite understand the way this is meant to work. The transform matrix notation is traditionally:\r\n\r\n```\r\n[ a, b, e ]\r\n[ c, d, f ]\r\n[ 0, 0, 1 ]\r\n```\r\n\r\nAnd when multiplying this matrix by a point, you are doing:\r\n\r\n```\r\n[ x ]     [ a, b, e ]     [ ax + by + e ]\r\n[ y ]  *  [ c, d, f ]  =  [ cx + dy + f ]\r\n[ 1 ]     [ 0, 0, 1 ]     [ 1           ]\r\n```\r\n\r\nSo I'm unclear why `transformPoint_()` uses a different equation to calculate the dot product. Under the notation above, I would have expected the dot product to be calculated like this (i.e. swap the `m.b` and `m.c`):\r\n\r\n```\r\nx: m.a * p.x + m.b * p.y + m.e * 1,\r\ny: m.c * p.x + m.d * p.y + m.f * 1,\r\n```\r\n\r\nIt's possible there is no bug here at all but I wanted to flag it down just in case it was a subtle issue."},"comment":{"url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/comments/267782813","html_url":"https://github.com/romannurik/AndroidIconAnimator/issues/84#issuecomment-267782813","issue_url":"https://api.github.com/repos/romannurik/AndroidIconAnimator/issues/84","id":267782813,"user":{"login":"romannurik","id":100155,"avatar_url":"https://avatars.githubusercontent.com/u/100155?v=3","gravatar_id":"","url":"https://api.github.com/users/romannurik","html_url":"https://github.com/romannurik","followers_url":"https://api.github.com/users/romannurik/followers","following_url":"https://api.github.com/users/romannurik/following{/other_user}","gists_url":"https://api.github.com/users/romannurik/gists{/gist_id}","starred_url":"https://api.github.com/users/romannurik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romannurik/subscriptions","organizations_url":"https://api.github.com/users/romannurik/orgs","repos_url":"https://api.github.com/users/romannurik/repos","events_url":"https://api.github.com/users/romannurik/events{/privacy}","received_events_url":"https://api.github.com/users/romannurik/received_events","type":"User","site_admin":false},"created_at":"2016-12-17T19:44:33Z","updated_at":"2016-12-17T19:44:33Z","body":"The notation is actually:\r\n\r\n```\r\na c e\r\nb d f\r\n0 0 1\r\n```\r\n\r\nSo I think we should be OK.."}}
{"actor":{"display_login":"romannurik"}}