{"action":"created","comment":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/45613504","id":45613504,"diff_hunk":"@@ -107,4 +108,30 @@ FloatPoint2DVectorList: class extends VectorList<FloatPoint2D> {\n \t\t\tresult = result >> this[i] toString() >> \"\\n\"\n \t\tresult\n \t}\n+\tresampleLinear: func (start, end, interval: Float) -> This {\n+\t\t// Assumes list is sorted by x values.\n+\t\tresultCount := ((end - start) / interval) ceil() as Int + 1\n+\t\tresult := This new()\n+\t\tpreviousIndex := 0\n+\t\tfor (i in 0 .. resultCount) {\n+\t\t\tpoint := FloatPoint2D new(start + i * interval, 0.0f)\n+\t\t\tif (point x <= this[0] x)\n+\t\t\t\tpoint y = this[0] y\n+\t\t\telse if (point x >= this[this count - 1] x)\n+\t\t\t\tpoint y = this[this count - 1] y\n+\t\t\telse {\n+\t\t\t\tleftPoint, rightPoint: FloatPoint2D\n+\t\t\t\tfor (j in previousIndex .. this count)\n+\t\t\t\t\tif (this[j] x <= point x) {\n+\t\t\t\t\t\tleftPoint = this[j]\n+\t\t\t\t\t\trightPoint = this[Int minimum(j + 1, this count - 1)]\n+\t\t\t\t\t\tpreviousIndex = j\n+\t\t\t\t\t} else break\n+\t\t\t\tweight := (Float absolute(point x - leftPoint x) / Float absolute(rightPoint x - leftPoint x)) clamp(0.0f, 1.0f)","path":"source/math/FloatPoint2DVectorList.ooc","position":31,"original_position":31,"commit_id":"525d77dee5461303b7d91fd5be0f1ed2a46ae15a","original_commit_id":"525d77dee5461303b7d91fd5be0f1ed2a46ae15a","user":{"login":"bettinaselig","id":11610114,"avatar_url":"https://avatars.githubusercontent.com/u/11610114?v=3","gravatar_id":"","url":"https://api.github.com/users/bettinaselig","html_url":"https://github.com/bettinaselig","followers_url":"https://api.github.com/users/bettinaselig/followers","following_url":"https://api.github.com/users/bettinaselig/following{/other_user}","gists_url":"https://api.github.com/users/bettinaselig/gists{/gist_id}","starred_url":"https://api.github.com/users/bettinaselig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bettinaselig/subscriptions","organizations_url":"https://api.github.com/users/bettinaselig/orgs","repos_url":"https://api.github.com/users/bettinaselig/repos","events_url":"https://api.github.com/users/bettinaselig/events{/privacy}","received_events_url":"https://api.github.com/users/bettinaselig/received_events","type":"User","site_admin":false},"body":"If `point x > rightPoint x`?","created_at":"2015-11-23T15:11:15Z","updated_at":"2015-11-23T15:11:15Z","html_url":"https://github.com/cogneco/ooc-kean/pull/869#discussion_r45613504","pull_request_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869","_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/45613504"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/869#discussion_r45613504"},"pull_request":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869"}}},"pull_request":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869","id":51512217,"html_url":"https://github.com/cogneco/ooc-kean/pull/869","diff_url":"https://github.com/cogneco/ooc-kean/pull/869.diff","patch_url":"https://github.com/cogneco/ooc-kean/pull/869.patch","issue_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/869","number":869,"state":"open","locked":false,"title":"Added ResampleLinear() to FloatPoint2DVectorList.","user":{"login":"niklasborwell","id":7765788,"avatar_url":"https://avatars.githubusercontent.com/u/7765788?v=3","gravatar_id":"","url":"https://api.github.com/users/niklasborwell","html_url":"https://github.com/niklasborwell","followers_url":"https://api.github.com/users/niklasborwell/followers","following_url":"https://api.github.com/users/niklasborwell/following{/other_user}","gists_url":"https://api.github.com/users/niklasborwell/gists{/gist_id}","starred_url":"https://api.github.com/users/niklasborwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklasborwell/subscriptions","organizations_url":"https://api.github.com/users/niklasborwell/orgs","repos_url":"https://api.github.com/users/niklasborwell/repos","events_url":"https://api.github.com/users/niklasborwell/events{/privacy}","received_events_url":"https://api.github.com/users/niklasborwell/received_events","type":"User","site_admin":false},"body":"Added a function to re-sample a data set with linear interpolation.","created_at":"2015-11-23T11:31:17Z","updated_at":"2015-11-23T15:11:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"950eb698b04c16340c831fab32324c05151925ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869/commits","review_comments_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869/comments","review_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/869/comments","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/525d77dee5461303b7d91fd5be0f1ed2a46ae15a","head":{"label":"niklasborwell:resample","ref":"resample","sha":"525d77dee5461303b7d91fd5be0f1ed2a46ae15a","user":{"login":"niklasborwell","id":7765788,"avatar_url":"https://avatars.githubusercontent.com/u/7765788?v=3","gravatar_id":"","url":"https://api.github.com/users/niklasborwell","html_url":"https://github.com/niklasborwell","followers_url":"https://api.github.com/users/niklasborwell/followers","following_url":"https://api.github.com/users/niklasborwell/following{/other_user}","gists_url":"https://api.github.com/users/niklasborwell/gists{/gist_id}","starred_url":"https://api.github.com/users/niklasborwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklasborwell/subscriptions","organizations_url":"https://api.github.com/users/niklasborwell/orgs","repos_url":"https://api.github.com/users/niklasborwell/repos","events_url":"https://api.github.com/users/niklasborwell/events{/privacy}","received_events_url":"https://api.github.com/users/niklasborwell/received_events","type":"User","site_admin":false},"repo":{"id":26220302,"name":"ooc-kean","full_name":"niklasborwell/ooc-kean","owner":{"login":"niklasborwell","id":7765788,"avatar_url":"https://avatars.githubusercontent.com/u/7765788?v=3","gravatar_id":"","url":"https://api.github.com/users/niklasborwell","html_url":"https://github.com/niklasborwell","followers_url":"https://api.github.com/users/niklasborwell/followers","following_url":"https://api.github.com/users/niklasborwell/following{/other_user}","gists_url":"https://api.github.com/users/niklasborwell/gists{/gist_id}","starred_url":"https://api.github.com/users/niklasborwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklasborwell/subscriptions","organizations_url":"https://api.github.com/users/niklasborwell/orgs","repos_url":"https://api.github.com/users/niklasborwell/repos","events_url":"https://api.github.com/users/niklasborwell/events{/privacy}","received_events_url":"https://api.github.com/users/niklasborwell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/niklasborwell/ooc-kean","description":"OOC port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/niklasborwell/ooc-kean","forks_url":"https://api.github.com/repos/niklasborwell/ooc-kean/forks","keys_url":"https://api.github.com/repos/niklasborwell/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niklasborwell/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niklasborwell/ooc-kean/teams","hooks_url":"https://api.github.com/repos/niklasborwell/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/niklasborwell/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/niklasborwell/ooc-kean/events","assignees_url":"https://api.github.com/repos/niklasborwell/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/niklasborwell/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/niklasborwell/ooc-kean/tags","blobs_url":"https://api.github.com/repos/niklasborwell/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niklasborwell/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niklasborwell/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/niklasborwell/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niklasborwell/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/niklasborwell/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/niklasborwell/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/niklasborwell/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/niklasborwell/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/niklasborwell/ooc-kean/subscription","commits_url":"https://api.github.com/repos/niklasborwell/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/niklasborwell/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/niklasborwell/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/niklasborwell/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/niklasborwell/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/niklasborwell/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niklasborwell/ooc-kean/merges","archive_url":"https://api.github.com/repos/niklasborwell/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niklasborwell/ooc-kean/downloads","issues_url":"https://api.github.com/repos/niklasborwell/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/niklasborwell/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/niklasborwell/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/niklasborwell/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niklasborwell/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/niklasborwell/ooc-kean/releases{/id}","created_at":"2014-11-05T13:16:40Z","updated_at":"2015-05-08T08:38:29Z","pushed_at":"2015-11-23T13:44:20Z","git_url":"git://github.com/niklasborwell/ooc-kean.git","ssh_url":"git@github.com:niklasborwell/ooc-kean.git","clone_url":"https://github.com/niklasborwell/ooc-kean.git","svn_url":"https://github.com/niklasborwell/ooc-kean","homepage":null,"size":27581,"stargazers_count":0,"watchers_count":0,"language":"ooc","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":"cogneco:master","ref":"master","sha":"866de009c29594c91bef4bcb805e22bf54065b83","user":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"cogneco/ooc-kean","owner":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cogneco/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/cogneco/ooc-kean","forks_url":"https://api.github.com/repos/cogneco/ooc-kean/forks","keys_url":"https://api.github.com/repos/cogneco/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cogneco/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cogneco/ooc-kean/teams","hooks_url":"https://api.github.com/repos/cogneco/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/cogneco/ooc-kean/events","assignees_url":"https://api.github.com/repos/cogneco/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/cogneco/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/cogneco/ooc-kean/tags","blobs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cogneco/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/cogneco/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/cogneco/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/cogneco/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/cogneco/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/cogneco/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/cogneco/ooc-kean/subscription","commits_url":"https://api.github.com/repos/cogneco/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/cogneco/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/cogneco/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/cogneco/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cogneco/ooc-kean/merges","archive_url":"https://api.github.com/repos/cogneco/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cogneco/ooc-kean/downloads","issues_url":"https://api.github.com/repos/cogneco/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/cogneco/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/cogneco/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/cogneco/ooc-kean/releases{/id}","created_at":"2014-10-15T13:42:17Z","updated_at":"2015-05-08T13:13:16Z","pushed_at":"2015-11-23T15:09:24Z","git_url":"git://github.com/cogneco/ooc-kean.git","ssh_url":"git@github.com:cogneco/ooc-kean.git","clone_url":"https://github.com/cogneco/ooc-kean.git","svn_url":"https://github.com/cogneco/ooc-kean","homepage":"","size":28040,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":80,"forks":18,"open_issues":80,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/869"},"issue":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/869"},"comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/869/comments"},"review_comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869/comments"},"review_comment":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/869/commits"},"statuses":{"href":"https://api.github.com/repos/cogneco/ooc-kean/statuses/525d77dee5461303b7d91fd5be0f1ed2a46ae15a"}}}}