{"action":"created","comment":{"url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/comments/52884597","id":52884597,"diff_hunk":"@@ -25,53 +24,62 @@ public Quaternion(double real, double imagX, double imagY, double imagZ)\n             _y = imagY;\n             _z = imagZ;\n             _w = real;\n-            _norm = ToNorm(real, imagX, imagY, imagZ);\n-            _abs = Math.Sqrt(_norm);\n-            _arg = Math.Acos(real/_abs);\n+            _normSquared = ToNorm(real, imagX, imagY, imagZ);\n+            _norm = Math.Sqrt(_normSquared); //TODO : robust _norm calculating\n+            _arg = Math.Acos(real / _normSquared);","path":"src/Spatial/Euclidean/Quaternion.cs","position":40,"original_position":40,"commit_id":"65afa662c54bcbe417dcc1baaa5be0e50526eba2","original_commit_id":"65afa662c54bcbe417dcc1baaa5be0e50526eba2","user":{"login":"JohanLarsson","id":1640096,"avatar_url":"https://avatars.githubusercontent.com/u/1640096?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanLarsson","html_url":"https://github.com/JohanLarsson","followers_url":"https://api.github.com/users/JohanLarsson/followers","following_url":"https://api.github.com/users/JohanLarsson/following{/other_user}","gists_url":"https://api.github.com/users/JohanLarsson/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanLarsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanLarsson/subscriptions","organizations_url":"https://api.github.com/users/JohanLarsson/orgs","repos_url":"https://api.github.com/users/JohanLarsson/repos","events_url":"https://api.github.com/users/JohanLarsson/events{/privacy}","received_events_url":"https://api.github.com/users/JohanLarsson/received_events","type":"User","site_admin":false},"body":"Should these be precomputed? Makes the struct bigger.","created_at":"2016-02-15T10:55:40Z","updated_at":"2016-02-15T10:55:40Z","html_url":"https://github.com/mathnet/mathnet-spatial/pull/28#discussion_r52884597","pull_request_url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/comments/52884597"},"html":{"href":"https://github.com/mathnet/mathnet-spatial/pull/28#discussion_r52884597"},"pull_request":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28","id":59301266,"html_url":"https://github.com/mathnet/mathnet-spatial/pull/28","diff_url":"https://github.com/mathnet/mathnet-spatial/pull/28.diff","patch_url":"https://github.com/mathnet/mathnet-spatial/pull/28.patch","issue_url":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/28","number":28,"state":"open","locked":false,"title":"New quaternions.","user":{"login":"MaLiN2223","id":7461791,"avatar_url":"https://avatars.githubusercontent.com/u/7461791?v=3","gravatar_id":"","url":"https://api.github.com/users/MaLiN2223","html_url":"https://github.com/MaLiN2223","followers_url":"https://api.github.com/users/MaLiN2223/followers","following_url":"https://api.github.com/users/MaLiN2223/following{/other_user}","gists_url":"https://api.github.com/users/MaLiN2223/gists{/gist_id}","starred_url":"https://api.github.com/users/MaLiN2223/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaLiN2223/subscriptions","organizations_url":"https://api.github.com/users/MaLiN2223/orgs","repos_url":"https://api.github.com/users/MaLiN2223/repos","events_url":"https://api.github.com/users/MaLiN2223/events{/privacy}","received_events_url":"https://api.github.com/users/MaLiN2223/received_events","type":"User","site_admin":false},"body":"I hope I did better than previous time.\r\nWhat I did : \r\nChanges : \r\n- **New Interfaces**:  \r\n\tIEquatable<Quaternion> and IFormattable\r\n- **Added constructors** :  \r\n\tpublic Quaternion(Vector v)  \r\n\tpublic Quaternion(DenseVector v)\r\n- **Changed constructors** :  \r\n\tpublic static Quaternion From4Vector(DenseVector v) (changed implementation for consistency with constructor Quaternion(double real, double imagX, double imagY, double imagZ))\r\n- **Added proporties** :  \r\n\tpublic static readonly Quaternion One;  \r\n\tpublic static readonly Quaternion Zero;\r\n- **Changed proporties**:   \r\n\tpublic double Abs (changed name to NormSquared - more accurate) \r\n- **Changed Fields** :  \r\n\tinstead of norm and abs now we have normSquared and norm \r\n- **Changed static methdos** :   \r\n\tprivate static double ToNorm(double real, double imagX, double imagY, double imagZ) (explicit private modifier)  \r\n\tprivate static Quaternion ToUnitQuaternion(double real, double imagX, double imagY, double imagZ)(explicit private modifier)  \r\n\tpublic static Quaternion operator /(Quaternion q1, Quaternion q2) (now is more robust)\r\n- **Added static methods**:   \r\n\tpublic static Quaternion operator +(double d,Quaternion q1) (because of implicit conversion - I dont want it to get buggy)  \r\n\tpublic static Quaternion operator -(double d,Quaternion q1)  \r\n\tpublic static Quaternion operator *(double d,Quaternion q1)  \r\n\tpublic static Quaternion operator /(double d,Quaternion q1)\r\n- **Changed instance methods** :  \r\n\tpublic Quaternion Scalar() (changed to property)  \r\n\tpublic Quaternion Vector() (changed to property)  \r\n\tpublic Quaternion UnitVector() (changed to property)  \r\n\tpublic Quaternion Sign() (changed to proeprty)  \r\n\tpublic Quaternion Inverse() (changed to property + letter 'd' at the end)\r\n- **Added instance methods**:   \r\n\tpublic bool Equals(Quaternion other)\r\n\tpublic string ToString(string format, IFormatProvider formatProvider)\r\n- **Removed instance methods** :   \r\n\tpublic Quaternion Add(double)\r\n\tpublic Quaternion Add(Quaternion)\r\n \tpublic Quaternion Subtract(double r) \r\n       public Quaternion Subtract(Quaternion q) \r\n       (etc. for API consistency - from now rely on operators)\r\n\r\nStill to do : \r\nActual Code\r\n- [ ] More robust norm calculation\r\n- [ ] Comments\r\n\r\n--\r\nTests:\r\n- [ ] DotProduct\r\n- [ ] Inversion\r\n- [ ] Equality, operator ==\r\n- [ ] ToString()\r\n- [ ] Norm\r\n- [ ] Conjugation\r\n- [ ] operators\r\n- [ ] Rotations\r\n- [ ] Constructors","created_at":"2016-02-14T17:59:03Z","updated_at":"2016-02-15T10:55:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f880b3498544856923d574da340e33f9783fcd7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28/commits","review_comments_url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28/comments","review_comment_url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/28/comments","statuses_url":"https://api.github.com/repos/mathnet/mathnet-spatial/statuses/65afa662c54bcbe417dcc1baaa5be0e50526eba2","head":{"label":"MaLiN2223:toUpload","ref":"toUpload","sha":"65afa662c54bcbe417dcc1baaa5be0e50526eba2","user":{"login":"MaLiN2223","id":7461791,"avatar_url":"https://avatars.githubusercontent.com/u/7461791?v=3","gravatar_id":"","url":"https://api.github.com/users/MaLiN2223","html_url":"https://github.com/MaLiN2223","followers_url":"https://api.github.com/users/MaLiN2223/followers","following_url":"https://api.github.com/users/MaLiN2223/following{/other_user}","gists_url":"https://api.github.com/users/MaLiN2223/gists{/gist_id}","starred_url":"https://api.github.com/users/MaLiN2223/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaLiN2223/subscriptions","organizations_url":"https://api.github.com/users/MaLiN2223/orgs","repos_url":"https://api.github.com/users/MaLiN2223/repos","events_url":"https://api.github.com/users/MaLiN2223/events{/privacy}","received_events_url":"https://api.github.com/users/MaLiN2223/received_events","type":"User","site_admin":false},"repo":{"id":51690205,"name":"mathnet-spatial","full_name":"MaLiN2223/mathnet-spatial","owner":{"login":"MaLiN2223","id":7461791,"avatar_url":"https://avatars.githubusercontent.com/u/7461791?v=3","gravatar_id":"","url":"https://api.github.com/users/MaLiN2223","html_url":"https://github.com/MaLiN2223","followers_url":"https://api.github.com/users/MaLiN2223/followers","following_url":"https://api.github.com/users/MaLiN2223/following{/other_user}","gists_url":"https://api.github.com/users/MaLiN2223/gists{/gist_id}","starred_url":"https://api.github.com/users/MaLiN2223/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaLiN2223/subscriptions","organizations_url":"https://api.github.com/users/MaLiN2223/orgs","repos_url":"https://api.github.com/users/MaLiN2223/repos","events_url":"https://api.github.com/users/MaLiN2223/events{/privacy}","received_events_url":"https://api.github.com/users/MaLiN2223/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaLiN2223/mathnet-spatial","description":"Math.NET Spatial","fork":true,"url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial","forks_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/forks","keys_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/teams","hooks_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/hooks","issue_events_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/issues/events{/number}","events_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/events","assignees_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/assignees{/user}","branches_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/branches{/branch}","tags_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/tags","blobs_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/statuses/{sha}","languages_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/languages","stargazers_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/stargazers","contributors_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/contributors","subscribers_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/subscribers","subscription_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/subscription","commits_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/contents/{+path}","compare_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/merges","archive_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/downloads","issues_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/issues{/number}","pulls_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/pulls{/number}","milestones_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/milestones{/number}","notifications_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/labels{/name}","releases_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/releases{/id}","deployments_url":"https://api.github.com/repos/MaLiN2223/mathnet-spatial/deployments","created_at":"2016-02-14T10:26:31Z","updated_at":"2016-02-14T10:26:33Z","pushed_at":"2016-02-14T17:58:35Z","git_url":"git://github.com/MaLiN2223/mathnet-spatial.git","ssh_url":"git@github.com:MaLiN2223/mathnet-spatial.git","clone_url":"https://github.com/MaLiN2223/mathnet-spatial.git","svn_url":"https://github.com/MaLiN2223/mathnet-spatial","homepage":"http://spatial.mathdotnet.com","size":22271,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mathnet:master","ref":"master","sha":"8cddd04aafdfb71ac2a161d8ff0055274414697f","user":{"login":"mathnet","id":97860,"avatar_url":"https://avatars.githubusercontent.com/u/97860?v=3","gravatar_id":"","url":"https://api.github.com/users/mathnet","html_url":"https://github.com/mathnet","followers_url":"https://api.github.com/users/mathnet/followers","following_url":"https://api.github.com/users/mathnet/following{/other_user}","gists_url":"https://api.github.com/users/mathnet/gists{/gist_id}","starred_url":"https://api.github.com/users/mathnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathnet/subscriptions","organizations_url":"https://api.github.com/users/mathnet/orgs","repos_url":"https://api.github.com/users/mathnet/repos","events_url":"https://api.github.com/users/mathnet/events{/privacy}","received_events_url":"https://api.github.com/users/mathnet/received_events","type":"Organization","site_admin":false},"repo":{"id":21280671,"name":"mathnet-spatial","full_name":"mathnet/mathnet-spatial","owner":{"login":"mathnet","id":97860,"avatar_url":"https://avatars.githubusercontent.com/u/97860?v=3","gravatar_id":"","url":"https://api.github.com/users/mathnet","html_url":"https://github.com/mathnet","followers_url":"https://api.github.com/users/mathnet/followers","following_url":"https://api.github.com/users/mathnet/following{/other_user}","gists_url":"https://api.github.com/users/mathnet/gists{/gist_id}","starred_url":"https://api.github.com/users/mathnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathnet/subscriptions","organizations_url":"https://api.github.com/users/mathnet/orgs","repos_url":"https://api.github.com/users/mathnet/repos","events_url":"https://api.github.com/users/mathnet/events{/privacy}","received_events_url":"https://api.github.com/users/mathnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mathnet/mathnet-spatial","description":"Math.NET Spatial","fork":false,"url":"https://api.github.com/repos/mathnet/mathnet-spatial","forks_url":"https://api.github.com/repos/mathnet/mathnet-spatial/forks","keys_url":"https://api.github.com/repos/mathnet/mathnet-spatial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathnet/mathnet-spatial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathnet/mathnet-spatial/teams","hooks_url":"https://api.github.com/repos/mathnet/mathnet-spatial/hooks","issue_events_url":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/events{/number}","events_url":"https://api.github.com/repos/mathnet/mathnet-spatial/events","assignees_url":"https://api.github.com/repos/mathnet/mathnet-spatial/assignees{/user}","branches_url":"https://api.github.com/repos/mathnet/mathnet-spatial/branches{/branch}","tags_url":"https://api.github.com/repos/mathnet/mathnet-spatial/tags","blobs_url":"https://api.github.com/repos/mathnet/mathnet-spatial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathnet/mathnet-spatial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathnet/mathnet-spatial/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathnet/mathnet-spatial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathnet/mathnet-spatial/statuses/{sha}","languages_url":"https://api.github.com/repos/mathnet/mathnet-spatial/languages","stargazers_url":"https://api.github.com/repos/mathnet/mathnet-spatial/stargazers","contributors_url":"https://api.github.com/repos/mathnet/mathnet-spatial/contributors","subscribers_url":"https://api.github.com/repos/mathnet/mathnet-spatial/subscribers","subscription_url":"https://api.github.com/repos/mathnet/mathnet-spatial/subscription","commits_url":"https://api.github.com/repos/mathnet/mathnet-spatial/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathnet/mathnet-spatial/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathnet/mathnet-spatial/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathnet/mathnet-spatial/contents/{+path}","compare_url":"https://api.github.com/repos/mathnet/mathnet-spatial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathnet/mathnet-spatial/merges","archive_url":"https://api.github.com/repos/mathnet/mathnet-spatial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathnet/mathnet-spatial/downloads","issues_url":"https://api.github.com/repos/mathnet/mathnet-spatial/issues{/number}","pulls_url":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls{/number}","milestones_url":"https://api.github.com/repos/mathnet/mathnet-spatial/milestones{/number}","notifications_url":"https://api.github.com/repos/mathnet/mathnet-spatial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathnet/mathnet-spatial/labels{/name}","releases_url":"https://api.github.com/repos/mathnet/mathnet-spatial/releases{/id}","deployments_url":"https://api.github.com/repos/mathnet/mathnet-spatial/deployments","created_at":"2014-06-27T15:38:32Z","updated_at":"2016-02-14T18:15:16Z","pushed_at":"2016-02-14T17:59:03Z","git_url":"git://github.com/mathnet/mathnet-spatial.git","ssh_url":"git@github.com:mathnet/mathnet-spatial.git","clone_url":"https://github.com/mathnet/mathnet-spatial.git","svn_url":"https://github.com/mathnet/mathnet-spatial","homepage":"http://spatial.mathdotnet.com","size":22469,"stargazers_count":31,"watchers_count":31,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":9,"forks":21,"open_issues":9,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28"},"html":{"href":"https://github.com/mathnet/mathnet-spatial/pull/28"},"issue":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/28"},"comments":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/mathnet/mathnet-spatial/statuses/65afa662c54bcbe417dcc1baaa5be0e50526eba2"}}}}