{"action":"created","comment":{"url":"https://api.github.com/repos/Deltares/wwa/pulls/comments/166441900","pull_request_review_id":94504378,"id":166441900,"diff_hunk":"@@ -1,19 +1,34 @@\n import { scaleLinear } from 'd3-scale'\n \n+/**\n+ * Convert from polar to cartesian coordinates\n+ * @param {Number} radius - sphere radius\n+ * @param {Number} latitude - in radians\n+ * @param {Number} longitude - in radians\n+ * @returns {THREE.Vector3} polar coordinate {x, y, z}\n+ */\n export function polar2cartesian (radius, latitude, longitude) {\n+  // inclination θ (latitude), azimuth φ (longitude)\n   const x = radius * Math.sin(latitude) * Math.cos(longitude)\n   const y = radius * Math.sin(latitude) * Math.sin(longitude)\n   const z = radius * Math.cos(latitude)\n \n   return { x, y, z }\n }\n \n+/**\n+ * Convert from cartesian to polar coordinates\n+ * @param {Number} x - x coordinate\n+ * @param {Number} y - y coordinate\n+ * @param {Number} z - z coordinate\n+ * @returns {Object} Object with r (radius), θ (latitude in radians), azimuth φ (longitude in radians)\n+ */\n export function cartesian2polar (x, y, z) {\n-  const radius = Math.sqrt((x * x) + (y * y) + (z * z))\n-  const latitude = Math.acos(z / radius)\n-  const longitude = Math.atan2(y, x)\n-\n-  return { radius, latitude, longitude }\n+  // radius r, inclination θ (latitude), azimuth φ (longitude)\n+  const r = Math.sqrt((x * x) + (y * y) + (z * z))\n+  const θ = Math.acos(z / r)\n+  const φ = Math.atan2(y, x)\n+  return { r, θ, φ }","path":"components/globe-component/common.js","position":null,"original_position":36,"commit_id":"e9507a187d6ce0c2763ab132867a03c943c89caf","original_commit_id":"6e7066c4db11416b7150301b26bd0283956829c2","user":{"login":"SiggyF","id":1632323,"avatar_url":"https://avatars2.githubusercontent.com/u/1632323?v=4","gravatar_id":"","url":"https://api.github.com/users/SiggyF","html_url":"https://github.com/SiggyF","followers_url":"https://api.github.com/users/SiggyF/followers","following_url":"https://api.github.com/users/SiggyF/following{/other_user}","gists_url":"https://api.github.com/users/SiggyF/gists{/gist_id}","starred_url":"https://api.github.com/users/SiggyF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SiggyF/subscriptions","organizations_url":"https://api.github.com/users/SiggyF/orgs","repos_url":"https://api.github.com/users/SiggyF/repos","events_url":"https://api.github.com/users/SiggyF/events{/privacy}","received_events_url":"https://api.github.com/users/SiggyF/received_events","type":"User","site_admin":false},"body":"also renamed functions for clarity","created_at":"2018-02-06T21:07:42Z","updated_at":"2018-02-06T21:07:42Z","html_url":"https://github.com/Deltares/wwa/pull/39#discussion_r166441900","pull_request_url":"https://api.github.com/repos/Deltares/wwa/pulls/39","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/comments/166441900"},"html":{"href":"https://github.com/Deltares/wwa/pull/39#discussion_r166441900"},"pull_request":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/39"}},"in_reply_to_id":166336878},"pull_request":{"url":"https://api.github.com/repos/Deltares/wwa/pulls/39","id":167415599,"html_url":"https://github.com/Deltares/wwa/pull/39","diff_url":"https://github.com/Deltares/wwa/pull/39.diff","patch_url":"https://github.com/Deltares/wwa/pull/39.patch","issue_url":"https://api.github.com/repos/Deltares/wwa/issues/39","number":39,"state":"open","locked":false,"title":"No marker no zoom","user":{"login":"SiggyF","id":1632323,"avatar_url":"https://avatars2.githubusercontent.com/u/1632323?v=4","gravatar_id":"","url":"https://api.github.com/users/SiggyF","html_url":"https://github.com/SiggyF","followers_url":"https://api.github.com/users/SiggyF/followers","following_url":"https://api.github.com/users/SiggyF/following{/other_user}","gists_url":"https://api.github.com/users/SiggyF/gists{/gist_id}","starred_url":"https://api.github.com/users/SiggyF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SiggyF/subscriptions","organizations_url":"https://api.github.com/users/SiggyF/orgs","repos_url":"https://api.github.com/users/SiggyF/repos","events_url":"https://api.github.com/users/SiggyF/events{/privacy}","received_events_url":"https://api.github.com/users/SiggyF/received_events","type":"User","site_admin":false},"body":"- Sync zoom with navigation (zoom from current camera position to location of activeMarker)\r\n- Fix coordinate problems (use consistent coordinate conversion)\r\n- Rotate camera instead of scene (z is up, for now positive down, don't know why....)","created_at":"2018-02-06T13:36:51Z","updated_at":"2018-02-06T21:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"faffd5b639d73277e0286cb54e55287edc465e41","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jurgenbelien","id":8565223,"avatar_url":"https://avatars2.githubusercontent.com/u/8565223?v=4","gravatar_id":"","url":"https://api.github.com/users/jurgenbelien","html_url":"https://github.com/jurgenbelien","followers_url":"https://api.github.com/users/jurgenbelien/followers","following_url":"https://api.github.com/users/jurgenbelien/following{/other_user}","gists_url":"https://api.github.com/users/jurgenbelien/gists{/gist_id}","starred_url":"https://api.github.com/users/jurgenbelien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurgenbelien/subscriptions","organizations_url":"https://api.github.com/users/jurgenbelien/orgs","repos_url":"https://api.github.com/users/jurgenbelien/repos","events_url":"https://api.github.com/users/jurgenbelien/events{/privacy}","received_events_url":"https://api.github.com/users/jurgenbelien/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/Deltares/wwa/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Deltares/wwa/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Deltares/wwa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Deltares/wwa/issues/39/comments","statuses_url":"https://api.github.com/repos/Deltares/wwa/statuses/e9507a187d6ce0c2763ab132867a03c943c89caf","head":{"label":"Deltares:no-marker-no-zoom","ref":"no-marker-no-zoom","sha":"e9507a187d6ce0c2763ab132867a03c943c89caf","user":{"login":"Deltares","id":6613768,"avatar_url":"https://avatars1.githubusercontent.com/u/6613768?v=4","gravatar_id":"","url":"https://api.github.com/users/Deltares","html_url":"https://github.com/Deltares","followers_url":"https://api.github.com/users/Deltares/followers","following_url":"https://api.github.com/users/Deltares/following{/other_user}","gists_url":"https://api.github.com/users/Deltares/gists{/gist_id}","starred_url":"https://api.github.com/users/Deltares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deltares/subscriptions","organizations_url":"https://api.github.com/users/Deltares/orgs","repos_url":"https://api.github.com/users/Deltares/repos","events_url":"https://api.github.com/users/Deltares/events{/privacy}","received_events_url":"https://api.github.com/users/Deltares/received_events","type":"Organization","site_admin":false},"repo":{"id":113964239,"name":"wwa","full_name":"Deltares/wwa","owner":{"login":"Deltares","id":6613768,"avatar_url":"https://avatars1.githubusercontent.com/u/6613768?v=4","gravatar_id":"","url":"https://api.github.com/users/Deltares","html_url":"https://github.com/Deltares","followers_url":"https://api.github.com/users/Deltares/followers","following_url":"https://api.github.com/users/Deltares/following{/other_user}","gists_url":"https://api.github.com/users/Deltares/gists{/gist_id}","starred_url":"https://api.github.com/users/Deltares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deltares/subscriptions","organizations_url":"https://api.github.com/users/Deltares/orgs","repos_url":"https://api.github.com/users/Deltares/repos","events_url":"https://api.github.com/users/Deltares/events{/privacy}","received_events_url":"https://api.github.com/users/Deltares/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Deltares/wwa","description":"World Water Atlas","fork":false,"url":"https://api.github.com/repos/Deltares/wwa","forks_url":"https://api.github.com/repos/Deltares/wwa/forks","keys_url":"https://api.github.com/repos/Deltares/wwa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Deltares/wwa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Deltares/wwa/teams","hooks_url":"https://api.github.com/repos/Deltares/wwa/hooks","issue_events_url":"https://api.github.com/repos/Deltares/wwa/issues/events{/number}","events_url":"https://api.github.com/repos/Deltares/wwa/events","assignees_url":"https://api.github.com/repos/Deltares/wwa/assignees{/user}","branches_url":"https://api.github.com/repos/Deltares/wwa/branches{/branch}","tags_url":"https://api.github.com/repos/Deltares/wwa/tags","blobs_url":"https://api.github.com/repos/Deltares/wwa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Deltares/wwa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Deltares/wwa/git/refs{/sha}","trees_url":"https://api.github.com/repos/Deltares/wwa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Deltares/wwa/statuses/{sha}","languages_url":"https://api.github.com/repos/Deltares/wwa/languages","stargazers_url":"https://api.github.com/repos/Deltares/wwa/stargazers","contributors_url":"https://api.github.com/repos/Deltares/wwa/contributors","subscribers_url":"https://api.github.com/repos/Deltares/wwa/subscribers","subscription_url":"https://api.github.com/repos/Deltares/wwa/subscription","commits_url":"https://api.github.com/repos/Deltares/wwa/commits{/sha}","git_commits_url":"https://api.github.com/repos/Deltares/wwa/git/commits{/sha}","comments_url":"https://api.github.com/repos/Deltares/wwa/comments{/number}","issue_comment_url":"https://api.github.com/repos/Deltares/wwa/issues/comments{/number}","contents_url":"https://api.github.com/repos/Deltares/wwa/contents/{+path}","compare_url":"https://api.github.com/repos/Deltares/wwa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Deltares/wwa/merges","archive_url":"https://api.github.com/repos/Deltares/wwa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Deltares/wwa/downloads","issues_url":"https://api.github.com/repos/Deltares/wwa/issues{/number}","pulls_url":"https://api.github.com/repos/Deltares/wwa/pulls{/number}","milestones_url":"https://api.github.com/repos/Deltares/wwa/milestones{/number}","notifications_url":"https://api.github.com/repos/Deltares/wwa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Deltares/wwa/labels{/name}","releases_url":"https://api.github.com/repos/Deltares/wwa/releases{/id}","deployments_url":"https://api.github.com/repos/Deltares/wwa/deployments","created_at":"2017-12-12T08:32:20Z","updated_at":"2018-01-22T14:08:06Z","pushed_at":"2018-02-06T21:07:09Z","git_url":"git://github.com/Deltares/wwa.git","ssh_url":"git@github.com:Deltares/wwa.git","clone_url":"https://github.com/Deltares/wwa.git","svn_url":"https://github.com/Deltares/wwa","homepage":null,"size":4701,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Deltares:master","ref":"master","sha":"a7b9b297f39e628f40210cf3d32b5d11c23a889b","user":{"login":"Deltares","id":6613768,"avatar_url":"https://avatars1.githubusercontent.com/u/6613768?v=4","gravatar_id":"","url":"https://api.github.com/users/Deltares","html_url":"https://github.com/Deltares","followers_url":"https://api.github.com/users/Deltares/followers","following_url":"https://api.github.com/users/Deltares/following{/other_user}","gists_url":"https://api.github.com/users/Deltares/gists{/gist_id}","starred_url":"https://api.github.com/users/Deltares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deltares/subscriptions","organizations_url":"https://api.github.com/users/Deltares/orgs","repos_url":"https://api.github.com/users/Deltares/repos","events_url":"https://api.github.com/users/Deltares/events{/privacy}","received_events_url":"https://api.github.com/users/Deltares/received_events","type":"Organization","site_admin":false},"repo":{"id":113964239,"name":"wwa","full_name":"Deltares/wwa","owner":{"login":"Deltares","id":6613768,"avatar_url":"https://avatars1.githubusercontent.com/u/6613768?v=4","gravatar_id":"","url":"https://api.github.com/users/Deltares","html_url":"https://github.com/Deltares","followers_url":"https://api.github.com/users/Deltares/followers","following_url":"https://api.github.com/users/Deltares/following{/other_user}","gists_url":"https://api.github.com/users/Deltares/gists{/gist_id}","starred_url":"https://api.github.com/users/Deltares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deltares/subscriptions","organizations_url":"https://api.github.com/users/Deltares/orgs","repos_url":"https://api.github.com/users/Deltares/repos","events_url":"https://api.github.com/users/Deltares/events{/privacy}","received_events_url":"https://api.github.com/users/Deltares/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Deltares/wwa","description":"World Water Atlas","fork":false,"url":"https://api.github.com/repos/Deltares/wwa","forks_url":"https://api.github.com/repos/Deltares/wwa/forks","keys_url":"https://api.github.com/repos/Deltares/wwa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Deltares/wwa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Deltares/wwa/teams","hooks_url":"https://api.github.com/repos/Deltares/wwa/hooks","issue_events_url":"https://api.github.com/repos/Deltares/wwa/issues/events{/number}","events_url":"https://api.github.com/repos/Deltares/wwa/events","assignees_url":"https://api.github.com/repos/Deltares/wwa/assignees{/user}","branches_url":"https://api.github.com/repos/Deltares/wwa/branches{/branch}","tags_url":"https://api.github.com/repos/Deltares/wwa/tags","blobs_url":"https://api.github.com/repos/Deltares/wwa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Deltares/wwa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Deltares/wwa/git/refs{/sha}","trees_url":"https://api.github.com/repos/Deltares/wwa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Deltares/wwa/statuses/{sha}","languages_url":"https://api.github.com/repos/Deltares/wwa/languages","stargazers_url":"https://api.github.com/repos/Deltares/wwa/stargazers","contributors_url":"https://api.github.com/repos/Deltares/wwa/contributors","subscribers_url":"https://api.github.com/repos/Deltares/wwa/subscribers","subscription_url":"https://api.github.com/repos/Deltares/wwa/subscription","commits_url":"https://api.github.com/repos/Deltares/wwa/commits{/sha}","git_commits_url":"https://api.github.com/repos/Deltares/wwa/git/commits{/sha}","comments_url":"https://api.github.com/repos/Deltares/wwa/comments{/number}","issue_comment_url":"https://api.github.com/repos/Deltares/wwa/issues/comments{/number}","contents_url":"https://api.github.com/repos/Deltares/wwa/contents/{+path}","compare_url":"https://api.github.com/repos/Deltares/wwa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Deltares/wwa/merges","archive_url":"https://api.github.com/repos/Deltares/wwa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Deltares/wwa/downloads","issues_url":"https://api.github.com/repos/Deltares/wwa/issues{/number}","pulls_url":"https://api.github.com/repos/Deltares/wwa/pulls{/number}","milestones_url":"https://api.github.com/repos/Deltares/wwa/milestones{/number}","notifications_url":"https://api.github.com/repos/Deltares/wwa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Deltares/wwa/labels{/name}","releases_url":"https://api.github.com/repos/Deltares/wwa/releases{/id}","deployments_url":"https://api.github.com/repos/Deltares/wwa/deployments","created_at":"2017-12-12T08:32:20Z","updated_at":"2018-01-22T14:08:06Z","pushed_at":"2018-02-06T21:07:09Z","git_url":"git://github.com/Deltares/wwa.git","ssh_url":"git@github.com:Deltares/wwa.git","clone_url":"https://github.com/Deltares/wwa.git","svn_url":"https://github.com/Deltares/wwa","homepage":null,"size":4701,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/39"},"html":{"href":"https://github.com/Deltares/wwa/pull/39"},"issue":{"href":"https://api.github.com/repos/Deltares/wwa/issues/39"},"comments":{"href":"https://api.github.com/repos/Deltares/wwa/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Deltares/wwa/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Deltares/wwa/statuses/e9507a187d6ce0c2763ab132867a03c943c89caf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SiggyF"}}