{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/6891","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/6891/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/6891/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/6891/events","html_url":"https://github.com/mrdoob/three.js/issues/6891","id":96503183,"number":6891,"title":"Confusing practices in Quaternion implementation","user":{"login":"lucasdealmeidasm","id":7352278,"avatar_url":"https://avatars.githubusercontent.com/u/7352278?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasdealmeidasm","html_url":"https://github.com/lucasdealmeidasm","followers_url":"https://api.github.com/users/lucasdealmeidasm/followers","following_url":"https://api.github.com/users/lucasdealmeidasm/following{/other_user}","gists_url":"https://api.github.com/users/lucasdealmeidasm/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasdealmeidasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasdealmeidasm/subscriptions","organizations_url":"https://api.github.com/users/lucasdealmeidasm/orgs","repos_url":"https://api.github.com/users/lucasdealmeidasm/repos","events_url":"https://api.github.com/users/lucasdealmeidasm/events{/privacy}","received_events_url":"https://api.github.com/users/lucasdealmeidasm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-22T08:04:23Z","updated_at":"2015-07-22T21:18:30Z","closed_at":null,"body":"In the current implementation of `THREE.Quaternion`, there are two different `.slerp` methods.\r\nSee http://threejs.org/docs/#Reference/Math/Quaternion.slerp\r\n\r\nThe former, `.slerp ( qa, qb, qm, t )` occurs when referencing the global `THREE.Quaternion` directly.\r\nThe latter, `.slerp (qb, t)` occurs in instances of `THREE.Quaternion`.\r\n\r\nThe latter is defined in (src/math/Quaternion.js#L400)\r\nAs it is in the prototype, instances of `THREE.Quaternion` will have it.\r\nThe former is defined in (src/math/Quaternion.js#L518)\r\nAs it is a write to the global `THREE.Quaternion`, only that will have it.\r\n\r\nFrom the web console:\r\n```\r\n>THREE.Quaternion.slerp\r\nfunction THREE.Quaternion.slerp(a, b, c, d)\r\n>var q = new THREE.Quaternion();\r\nT…E.Quaternion {_x: 0, _y: 0, _z: 0, _w: 1}\r\n>q.slerp\r\nfunction THREE.Quaternion.slerp(a, b)\r\n>q.slerp==THREE.Quaternion.slerp\r\nfalse\r\n```\r\n\r\nWhile not wrong, this is quite confusing, as the documentation does not tell which one is where.\r\nTherefore, one must look in the code to figure this out, and even then it remains confusing, specially as one of the functions is in the very end of the file.\r\nFurther, the current formatting of the documentation is presented as if all methods present occur in instances.\r\nFurther, it is easy to, reading the docs, misinterpret it as stating that there is only one function and it will check the type of the arguments to figure if you are passing `qa,qb,qm,t` or `qb,t`.\r\nFurther, I believe this is not that great of a code practice at all, to have `Foo.bar != Foo.prototype.bar`.\r\nI believe easiest solution is to rename one of those, to reflect behavior."},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/123867883","html_url":"https://github.com/mrdoob/three.js/issues/6891#issuecomment-123867883","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/6891","id":123867883,"user":{"login":"lucasdealmeidasm","id":7352278,"avatar_url":"https://avatars.githubusercontent.com/u/7352278?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasdealmeidasm","html_url":"https://github.com/lucasdealmeidasm","followers_url":"https://api.github.com/users/lucasdealmeidasm/followers","following_url":"https://api.github.com/users/lucasdealmeidasm/following{/other_user}","gists_url":"https://api.github.com/users/lucasdealmeidasm/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasdealmeidasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasdealmeidasm/subscriptions","organizations_url":"https://api.github.com/users/lucasdealmeidasm/orgs","repos_url":"https://api.github.com/users/lucasdealmeidasm/repos","events_url":"https://api.github.com/users/lucasdealmeidasm/events{/privacy}","received_events_url":"https://api.github.com/users/lucasdealmeidasm/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T21:18:30Z","updated_at":"2015-07-22T21:18:30Z","body":"Well I did understand their difference in behavior, but the documentation is lacking.\r\n\r\nThough my suggestion wasn't removing either of the methods. It is clear both are useful. My suggestion was to call one of them by another name."}}