{"id":18263103,"url":"https://github.com/ratwolfzero/hopalong","last_synced_at":"2025-04-09T01:26:18.773Z","repository":{"id":197481453,"uuid":"698728832","full_name":"ratwolfzero/hopalong","owner":"ratwolfzero","description":"\"Hopalong attractor\" calculate, display and save as image","archived":false,"fork":false,"pushed_at":"2024-08-29T00:31:02.000Z","size":2420,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-29T01:37:01.345Z","etag":null,"topics":["attractors","fractals","hopalong","rust-lang","strange-attractors"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratwolfzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-30T19:27:25.000Z","updated_at":"2024-08-29T00:31:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"58e89b9b-be2a-4f16-9593-cf8bc1729f5b","html_url":"https://github.com/ratwolfzero/hopalong","commit_stats":null,"previous_names":["ratwolfzero/hopalong"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2Fhopalong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2Fhopalong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2Fhopalong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2Fhopalong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratwolfzero","download_url":"https://codeload.github.com/ratwolfzero/hopalong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247955002,"owners_count":21024325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attractors","fractals","hopalong","rust-lang","strange-attractors"],"created_at":"2024-11-05T11:09:51.738Z","updated_at":"2025-04-09T01:26:18.275Z","avatar_url":"https://github.com/ratwolfzero.png","language":"Rust","readme":"# hopalong\n\n![Example Attractor Image](./Examples/num=200000000_a=-2_b=-0.33_c=0.01.png)\n\n## Abstract\n\n### Historical Context\n\nThe \"*Hopalong*\"\u003ctop\u003e*\u003ctop\u003e attractor, authored by Barry Martin of Aston University in Birmingham, England [2], was popularized by A.K. Dewdney in the September 1986 issue of *Scientific American*. In Germany, it gained further recognition through a translation titled \"*HÜPFER*\" in *Spektrum der Wissenschaft* [3].  \n\u003csub\u003e*Nicknamed by A.K. Dewdney.\u003c/sub\u003e  \n\n### The Hopalong Attractor Functions\n\nThis Rust program computes and visualizes the “hopalong” attractor by iterating the following system of recursive functions:\n\n$$\n\\large\n\\begin{cases}\nx_{n+1} = y_n - \\text{sgn}(x_n) \\sqrt{\\lvert b x_n - c \\rvert} \\\\\ny_{n+1} = a - x_n\n\\end{cases}\n\\large\n$$\n\nWhere:\n\n- The sequence starts from the initial point (x\u003csub\u003e0\u003c/sub\u003e , y\u003csub\u003e0\u003c/sub\u003e) = (0 , 0)\n- x\u003csub\u003en\u003c/sub\u003e and y\u003csub\u003en\u003c/sub\u003e represent the coordinates at the n-th iteration\n- a, b, and c are parameters influencing the attractor's dynamics\n- *sgn* is the *signum* function\n\n### Features and Further Information\n\nThe color scheme is based on the pixel density, i.e. how often a pixel of the image is hit during the iteration.\n\nFor more information in general and about “pixel density”, i.e. displaying the attractor as a density heatmap, see my Python versions repository.\n\n\u003chttps://github.com/ratwolfzero/hopalong_python\u003e\n\nFor information on the implementation of the Signum function in Rust, see:\n  \n\u003chttps://docs.rs/num-traits/latest/num_traits/sign/fn.signum.html\u003e\n\nYou can run this program from the command line in a terminal.\n\nThe number of iterations (num) can be entered as integer or in exponential form such as 1e6.  \n\nExample: ./hopalong -2 -0.33 0.01 2e8 (MacOS)\n\nIf you are using a Mac with Apple Silicon you should be able to use the executable in the 'Binary' folder.  \n\nThe binary was compiled on a Mac Mini with M2 processor.  \nThe calculated image should be displayed but there will be an error regarding saving the image.\n\n    // Save the image with the generated name\n    let save_path = format!(\"/Users/ralf//Projects/hopalong_pictures/{}\", image_name); // Specify your desired save path\n    if let Err(e) = image_buffer.save_with_format(\u0026save_path, ImageFormat::Png) {\n        eprintln!(\"Error saving image: {}\", e);\n    } else {\n        println!(\"Image saved to: {}\", save_path);\n    }\n\n----------------------------------------------------------------------------------------------------------------------------------------------------\n\n## References\n\n[1]  \n**J. Lansdown and R. A. Earnshaw (eds.)**, *Computers in Art, Design and Animation*.  \n New York: Springer-Verlag, 1989.  \n e-ISBN-13: 978-1-4612-4538-4.  \n\n[2]  \n**Barry Martin**, \"Graphic Potential of Recursive Functions,\" in *Computers in Art, Design and Animation* [1],  \npp. 109–129.\n\n[3]  \n**A.K. Dewdney**, Program \"HÜPFER,\" in *Spektrum der Wissenschaft: Computer Kurzweil*.  \nSpektrum der Wissenschaft Verlagsgesellschaft mbH \u0026 Co., Heidelberg, 1988.  \n(German version of *Scientific American*).  \nISBN-10: 3922508502, ISBN-13: 978-3922508502.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratwolfzero%2Fhopalong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratwolfzero%2Fhopalong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratwolfzero%2Fhopalong/lists"}