{"id":28991456,"url":"https://github.com/raphaelsenn/newton-raphson-fractals","last_synced_at":"2025-06-25T01:32:06.169Z","repository":{"id":194556141,"uuid":"691081188","full_name":"raphaelsenn/newton-raphson-fractals","owner":"raphaelsenn","description":"Generate stunning Newton-Raphson fractal images in .ppm format, with your own polynomials.","archived":false,"fork":false,"pushed_at":"2024-11-12T06:48:30.000Z","size":1281,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T09:51:11.425Z","etag":null,"topics":["complex-numbers","cpp","fractal","fractal-images","fractals","mathematics","newton-raphson","ppm-format","ppm-image"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphaelsenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-13T13:13:29.000Z","updated_at":"2024-11-12T06:48:34.000Z","dependencies_parsed_at":"2024-11-12T07:27:06.866Z","dependency_job_id":"cdbb52ab-51d0-4cf0-8d3d-3c36756b95fe","html_url":"https://github.com/raphaelsenn/newton-raphson-fractals","commit_stats":null,"previous_names":["raphsenn/newton-raphson-fractals","raphaelsenn/newton-raphson-fractals"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/newton-raphson-fractals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fnewton-raphson-fractals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fnewton-raphson-fractals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fnewton-raphson-fractals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fnewton-raphson-fractals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/newton-raphson-fractals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fnewton-raphson-fractals/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261785219,"owners_count":23209263,"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":["complex-numbers","cpp","fractal","fractal-images","fractals","mathematics","newton-raphson","ppm-format","ppm-image"],"created_at":"2025-06-25T01:31:46.254Z","updated_at":"2025-06-25T01:32:06.078Z","avatar_url":"https://github.com/raphaelsenn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Newton-Raphson-Fractals\n\nNewton-Raphson fractals are captivating and visually stunning representations of complex polynomial equations.\n\nNewton fractal for $\\ z^8-15z^4-16$, $\\ z^{12} - 1$ and $\\ z^5-1$\n\n\u003cp float=\"left\"\u003e\n   \u003cimg src=\"./rsc/z^8-15z^4-16.png\" width=200 height=200\u003e\n   \u003cimg src=\"./rsc/z^12-1.png\" width=200 height=200\u003e\n    \u003cimg src=\"./rsc/z^4-1.png\" width=200 height=200\u003e\n\u003c/p\u003e\n\nNewton fractal for $\\ z^3 - 1$, $\\ z^8 - 1$ and $\\ z^3-2z-2$\n\n\u003cp float=\"left\"\u003e\n   \u003cimg src=\"./rsc/z^3-1.png\" width=200 height=200\u003e\n   \u003cimg src=\"./rsc/z^8-1-ppm.png\" width=200 height=200\u003e\n    \u003cimg src=\"./rsc/z^3-2z-2.png\" width=200 height=200\u003e\n\u003c/p\u003e\n\n## Mathematical expressions\nIn the syntax of this program, mathematical expressions involving complex numbers are made intuitive.\n\n### For Example\n\n```cpp\nComplex z(1, 1);\nComplex u = z * z * z // represends z^3\n\nComplex w = Complex(12, 0) * z * z // represends 12 * z^2\n\nComplex x = z*z*z*z - 1 // represends z^4 - 1\n```\n\n## Getting Started with make\nTo create captivating Newton-Raphson fractal images with this program, follow these simple steps to get started:\n\n1. **Define Your Polynomial:** Open the main.cpp file within the project directory. Here, you can define your complex polynomial equation f(z) and its derivative df(z) inside the provided functions Complex f(Complex z) and Complex df(Complex z). Customize these functions with your own polynomial expressions as desired.\n\n```cpp\nComplex f(Complex z) {\n    return z * z * z - 1; // Define your complex polynomial here (represends z^3 - 1)\n}\n\nComplex df(Complex z) {\n    return Complex(3, 0) * (z * z); // Define the derivative of your polynomial here (represends 3 * z^2)\n}\n```\n2. **Save Your Changes:** Save the modifications you made to main.cpp.\n\n3. **Build the Program:** Use the provided Makefile to build the program. Run the following command:\n```shell\nmake all\n```\n\n4. **Generate the Fractal:** Execute the program to generate the fractal image based on your custom polynomial equation:\n```shell\n./main\n```\n7. **Finished:** The generated fractal image will be saved as **fractal.ppm** in the project directory.\n\n## Getting Started without make\nTo create captivating Newton-Raphson fractal images with this program, follow these simple steps to get started:\n\n\n1. **Define Your Polynomial:** Open the main.cpp file within the project directory. Here, you can define your complex polynomial equation f(z) and its derivative df(z) inside the provided functions Complex f(Complex z) and Complex df(Complex z). Customize these functions with your own polynomial expressions as desired.\n```shell\nComplex f(Complex z) {\n    return z * z * z - 1; // Define your complex polynomial here (represends z^3 - 1)\n}\n\nComplex df(Complex z) {\n    return Complex(3, 0) * (z * z); // Define the derivative of your polynomial here (represends 3 * z^2)\n}\n```\n2. **Save Your Changes:** Save the modifications you made to main.cpp.\n\n3. **Build the Program:** Here's the order of commands to compile the main program without using make, assuming you have the source files complex.cpp, complex.h and main.cpp:\n\n```shell\ng++ -c complex.cpp\ng++ -c main.cpp\ng++ complex.o main.o -o main\n```\n\n4. **Generate the Fractal:** Execute the program to generate the fractal image based on your custom polynomial equation:\n```shell\n./main\n```\n5. **Finished:** The generated fractal image will be saved as **fractal.ppm** in the project directory.\n## Error solving\nIf you encounter an error message similar to the following:\n\n```shell\nUser\ng++ -c complex.cpp\ncc   main.o complex.o   -o main\n/usr/bin/ld: complex.o: in function `abs(Complex)':\ncomplex.cpp:(.text+0x7a4): undefined reference to `sqrt'\ncollect2: error: ld returned 1 exit status\n```\nTo resolve this issue, you need to link the math library explicitly when compiling your program. You can do this by adding the -lm flag to your compile command, like this:\n\n```shell\ng++ main.o complex.o -o main -lm\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fnewton-raphson-fractals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fnewton-raphson-fractals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fnewton-raphson-fractals/lists"}