{"action":"opened","number":3,"pull_request":{"url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3","id":51828860,"html_url":"https://github.com/CultivateHQ/elixir_mandelbrot/pull/3","diff_url":"https://github.com/CultivateHQ/elixir_mandelbrot/pull/3.diff","patch_url":"https://github.com/CultivateHQ/elixir_mandelbrot/pull/3.patch","issue_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/3","number":3,"state":"open","locked":false,"title":"Mandelbrot set calculations","user":{"login":"munckymagik","id":306583,"avatar_url":"https://avatars.githubusercontent.com/u/306583?v=3","gravatar_id":"","url":"https://api.github.com/users/munckymagik","html_url":"https://github.com/munckymagik","followers_url":"https://api.github.com/users/munckymagik/followers","following_url":"https://api.github.com/users/munckymagik/following{/other_user}","gists_url":"https://api.github.com/users/munckymagik/gists{/gist_id}","starred_url":"https://api.github.com/users/munckymagik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munckymagik/subscriptions","organizations_url":"https://api.github.com/users/munckymagik/orgs","repos_url":"https://api.github.com/users/munckymagik/repos","events_url":"https://api.github.com/users/munckymagik/events{/privacy}","received_events_url":"https://api.github.com/users/munckymagik/received_events","type":"User","site_admin":false},"body":"## Summary\r\n\r\nThis PR introduces a module with functions to determine if a given complex value,  (usually denoted as `C`), is a member of the Mandelbrot set. \r\n\r\nThe key function is `count_iterations`; it returns the number of iterations of a special calculation (`f(Z): Z^2 + C` I'm referring to this as \"the polynomial\" for lack of a more specific name) are needed to prove whether `c` is a member of the Mandelbrot set, up to a maximum of `max_iterations`. Basically if the output of the calculation ever exceeds 2 it not part of the set, but we could search forever for some values so we limit the search to `max_iterations`.\r\n\r\nAn example from my tests:\r\n\r\n```elixir\r\nnot_in_the_set = Complex.new(1, 0)\r\nin_the_set = Complex.new(-1, 0)\r\n\r\nassert MandelbrotSet.count_iterations(not_in_the_set, 100) == 3\r\nassert MandelbrotSet.count_iterations(in_the_set, 100) == 100\r\n```\r\n\r\n## Background information\r\n\r\n  * https://en.wikipedia.org/wiki/Mandelbrot_set\r\n  * http://stackoverflow.com/questions/425953/how-to-program-a-fractal\r\n\r\n## Generating docs\r\n\r\nI added support for doc comments.\r\n\r\n```\r\nmix deps.get\r\nmix docs\r\nopen doc/index.html\r\n```\r\n\r\n## Further work\r\n\r\n* Add [typespecs](http://elixir-lang.org/getting-started/typespecs-and-behaviours.html)\r\n* Build something that iterates across the pixels of an image, translates them to the \"complex plane\", then for each value in the complex plane work out if it is in the Mandelbrot set.\r\n* Translate the iteration counts of each number to a colour value using a colour ramp.\r\n* Output an image.","created_at":"2015-11-25T18:14:01Z","updated_at":"2015-11-25T18:14:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3/commits","review_comments_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3/comments","review_comment_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/3/comments","statuses_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/statuses/e9b8f288018c1106bff1372f69547a6c1e7e19b2","head":{"label":"CultivateHQ:mandelbrot_set","ref":"mandelbrot_set","sha":"e9b8f288018c1106bff1372f69547a6c1e7e19b2","user":{"login":"CultivateHQ","id":8439061,"avatar_url":"https://avatars.githubusercontent.com/u/8439061?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateHQ","html_url":"https://github.com/CultivateHQ","followers_url":"https://api.github.com/users/CultivateHQ/followers","following_url":"https://api.github.com/users/CultivateHQ/following{/other_user}","gists_url":"https://api.github.com/users/CultivateHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateHQ/subscriptions","organizations_url":"https://api.github.com/users/CultivateHQ/orgs","repos_url":"https://api.github.com/users/CultivateHQ/repos","events_url":"https://api.github.com/users/CultivateHQ/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":46852442,"name":"elixir_mandelbrot","full_name":"CultivateHQ/elixir_mandelbrot","owner":{"login":"CultivateHQ","id":8439061,"avatar_url":"https://avatars.githubusercontent.com/u/8439061?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateHQ","html_url":"https://github.com/CultivateHQ","followers_url":"https://api.github.com/users/CultivateHQ/followers","following_url":"https://api.github.com/users/CultivateHQ/following{/other_user}","gists_url":"https://api.github.com/users/CultivateHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateHQ/subscriptions","organizations_url":"https://api.github.com/users/CultivateHQ/orgs","repos_url":"https://api.github.com/users/CultivateHQ/repos","events_url":"https://api.github.com/users/CultivateHQ/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CultivateHQ/elixir_mandelbrot","description":"A Mandelbrot fractal generator in Elixir","fork":false,"url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot","forks_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/forks","keys_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/teams","hooks_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/hooks","issue_events_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/events{/number}","events_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/events","assignees_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/assignees{/user}","branches_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/branches{/branch}","tags_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/tags","blobs_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/refs{/sha}","trees_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/statuses/{sha}","languages_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/languages","stargazers_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/stargazers","contributors_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/contributors","subscribers_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/subscribers","subscription_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/subscription","commits_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/commits{/sha}","git_commits_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/commits{/sha}","comments_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/comments{/number}","issue_comment_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/comments{/number}","contents_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/contents/{+path}","compare_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/merges","archive_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/downloads","issues_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues{/number}","pulls_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls{/number}","milestones_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/milestones{/number}","notifications_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/labels{/name}","releases_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/releases{/id}","created_at":"2015-11-25T09:50:20Z","updated_at":"2015-11-25T10:54:52Z","pushed_at":"2015-11-25T18:14:01Z","git_url":"git://github.com/CultivateHQ/elixir_mandelbrot.git","ssh_url":"git@github.com:CultivateHQ/elixir_mandelbrot.git","clone_url":"https://github.com/CultivateHQ/elixir_mandelbrot.git","svn_url":"https://github.com/CultivateHQ/elixir_mandelbrot","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"CultivateHQ:temp_merge_base_for_mandelbrot_set","ref":"temp_merge_base_for_mandelbrot_set","sha":"f18609306e90807783a1dfe57734e9c6c74ce70f","user":{"login":"CultivateHQ","id":8439061,"avatar_url":"https://avatars.githubusercontent.com/u/8439061?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateHQ","html_url":"https://github.com/CultivateHQ","followers_url":"https://api.github.com/users/CultivateHQ/followers","following_url":"https://api.github.com/users/CultivateHQ/following{/other_user}","gists_url":"https://api.github.com/users/CultivateHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateHQ/subscriptions","organizations_url":"https://api.github.com/users/CultivateHQ/orgs","repos_url":"https://api.github.com/users/CultivateHQ/repos","events_url":"https://api.github.com/users/CultivateHQ/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":46852442,"name":"elixir_mandelbrot","full_name":"CultivateHQ/elixir_mandelbrot","owner":{"login":"CultivateHQ","id":8439061,"avatar_url":"https://avatars.githubusercontent.com/u/8439061?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateHQ","html_url":"https://github.com/CultivateHQ","followers_url":"https://api.github.com/users/CultivateHQ/followers","following_url":"https://api.github.com/users/CultivateHQ/following{/other_user}","gists_url":"https://api.github.com/users/CultivateHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateHQ/subscriptions","organizations_url":"https://api.github.com/users/CultivateHQ/orgs","repos_url":"https://api.github.com/users/CultivateHQ/repos","events_url":"https://api.github.com/users/CultivateHQ/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CultivateHQ/elixir_mandelbrot","description":"A Mandelbrot fractal generator in Elixir","fork":false,"url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot","forks_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/forks","keys_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/teams","hooks_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/hooks","issue_events_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/events{/number}","events_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/events","assignees_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/assignees{/user}","branches_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/branches{/branch}","tags_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/tags","blobs_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/refs{/sha}","trees_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/statuses/{sha}","languages_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/languages","stargazers_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/stargazers","contributors_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/contributors","subscribers_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/subscribers","subscription_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/subscription","commits_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/commits{/sha}","git_commits_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/git/commits{/sha}","comments_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/comments{/number}","issue_comment_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/comments{/number}","contents_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/contents/{+path}","compare_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/merges","archive_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/downloads","issues_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues{/number}","pulls_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls{/number}","milestones_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/milestones{/number}","notifications_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/labels{/name}","releases_url":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/releases{/id}","created_at":"2015-11-25T09:50:20Z","updated_at":"2015-11-25T10:54:52Z","pushed_at":"2015-11-25T18:14:01Z","git_url":"git://github.com/CultivateHQ/elixir_mandelbrot.git","ssh_url":"git@github.com:CultivateHQ/elixir_mandelbrot.git","clone_url":"https://github.com/CultivateHQ/elixir_mandelbrot.git","svn_url":"https://github.com/CultivateHQ/elixir_mandelbrot","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3"},"html":{"href":"https://github.com/CultivateHQ/elixir_mandelbrot/pull/3"},"issue":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/3"},"comments":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/CultivateHQ/elixir_mandelbrot/statuses/e9b8f288018c1106bff1372f69547a6c1e7e19b2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":5,"additions":126,"deletions":1,"changed_files":4}}