{"id":18792359,"url":"https://github.com/kplanisphere/polar-function-graphing","last_synced_at":"2026-05-18T09:33:04.458Z","repository":{"id":241975382,"uuid":"808356215","full_name":"KPlanisphere/polar-function-graphing","owner":"KPlanisphere","description":"Proyecto 1 - Graficación","archived":false,"fork":false,"pushed_at":"2024-05-30T22:51:36.000Z","size":323,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T06:04:46.002Z","etag":null,"topics":["algorithm-implementation","color-variation","computer-graphics","cpp","data-visualization","graphing","opengl","polar-coordinates","rose-curve"],"latest_commit_sha":null,"homepage":"https://linktr.ee/planisphere.kgz","language":"C++","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/KPlanisphere.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":"2024-05-30T22:45:14.000Z","updated_at":"2024-05-30T22:55:01.000Z","dependencies_parsed_at":"2024-05-31T00:52:29.471Z","dependency_job_id":"d63a94ce-271a-4e3f-8567-ebb7c31b9b2b","html_url":"https://github.com/KPlanisphere/polar-function-graphing","commit_stats":null,"previous_names":["kplanisphere/polar-function-graphing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KPlanisphere/polar-function-graphing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fpolar-function-graphing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fpolar-function-graphing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fpolar-function-graphing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fpolar-function-graphing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KPlanisphere","download_url":"https://codeload.github.com/KPlanisphere/polar-function-graphing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fpolar-function-graphing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithm-implementation","color-variation","computer-graphics","cpp","data-visualization","graphing","opengl","polar-coordinates","rose-curve"],"created_at":"2024-11-07T21:19:37.846Z","updated_at":"2026-05-18T09:33:04.442Z","avatar_url":"https://github.com/KPlanisphere.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polar Function Graphing\n\n### Description\nThis project, completed as part of the coursework at the Benemérita Universidad Autónoma de Puebla, focuses on graphing a polar function using OpenGL in the Code::Blocks IDE. The aim is to visualize a polar function, specifically a Rose Curve, and explore variations in shape and color.\n\n### Overview\nPolar coordinates offer a different way of representing points in a plane compared to Cartesian coordinates. In this system, each point is determined by an angle and a distance from a central point (the pole). This method is particularly useful for objects moving in circular paths, simplifying their equations of motion.\n\n### Objectives\n- Implement and visualize a polar function using OpenGL.\n- Apply learned concepts to modify the graph's shape and color.\n- Develop an understanding of polar coordinates and their applications in computer graphics.\n\n### Key Features\n- **Initialization**: Set up the OpenGL environment and window properties.\n- **Graphing Function**: Calculate and plot points for the Rose Curve.\n- **Color Variation**: Implement a color scheme that changes with the angle to create a rainbow effect.\n\n### Project Structure\nThe project includes the following main components:\n\n#### Initialization\nThis function sets up the OpenGL environment, defining the color of the window and the projection parameters.\n\n```cpp\nvoid init(void) {\n    glClearColor(0.0, 0.0, 0.0, 1.0);\n    glMatrixMode(GL_PROJECTION);\n    glLoadIdentity();\n    gluOrtho2D(-200, 200, -200, 200);\n    glMatrixMode(GL_MODELVIEW);\n    glLoadIdentity();\n}\n```\n\n#### Graphing Function\n\nThis function draws the graph by converting polar coordinates to Cartesian coordinates and assigns colors to each point based on its angle.\n\n```cpp\nvoid dibujaGrafica() {\n    float x, y, rpolar, angulo, r, g, b;\n    glClear(GL_COLOR_BUFFER_BIT);\n    angulo = 0;\n    glPointSize(1);\n\n    for (i = 0; i \u003c 720; i++) {\n        rpolar = 5 * cos(4 * angulo);\n        x = (rpolar * cos(angulo)) * (25);\n        y = (rpolar * sin(angulo)) * (25);\n\n        if (i \u003c= 240) {\n            r = 1.0;\n            g = 0.0;\n            b = 0.0;\n        } else if ((i \u003e 240) \u0026\u0026 (i \u003c= 480)) {\n            r = 0.0;\n            g = 1.0;\n            b = 0.0;\n        } else if ((i \u003e 480) \u0026\u0026 (i \u003c= 720)) {\n            r = 0.0;\n            g = 0.0;\n            b = 1.0;\n        }\n        glColor3f(r, g, b);\n        glBegin(GL_POINTS);\n        glVertex2i(x, y);\n        glEnd();\n        angulo = angulo + 0.5;\n    }\n    glFlush();\n}\n```\n\n#### Main Function\n\nThis function initializes the graphics window and starts the main loop.\n\n```cpp\nint main(int argc, char** argv) {\n    glutInit(\u0026argc, argv);\n    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);\n    glutInitWindowPosition(100, 100);\n    glutInitWindowSize(400, 400);\n    glutCreateWindow(\"Curva Rosa\");\n    init();\n    glutDisplayFunc(dibujaGrafica);\n    glutMainLoop();\n\n    return 0;\n}\n```\n\n### Execution\n\nThe project initializes a graphical window and plots a Rose Curve with a rainbow color effect. The transition of colors is smooth, providing a visual representation of the mathematical function in a creative manner.\n\n\u003cp align= \"center\"\u003e\n    \u003cimg src=\"https://github.com/KPlanisphere/binary-tree-operations/assets/60454942/9c05945b-f26a-4c6c-a1ae-c9c88b13f6f9\" style=\"width: 70%; height: auto;\"\u003e\n\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplanisphere%2Fpolar-function-graphing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkplanisphere%2Fpolar-function-graphing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplanisphere%2Fpolar-function-graphing/lists"}