{"id":14986361,"url":"https://github.com/BeyzaKomish/C-Sharp-Create-Polygon_Project","last_synced_at":"2026-02-06T17:30:19.394Z","repository":{"id":247239393,"uuid":"823643317","full_name":"BeyzaKomish/C-Sharp-Create-Polygon_Project","owner":"BeyzaKomish","description":"This C# program allows users to create and manipulate polygons using a graphical user interface. Users can input the center, length, number of edges, and rotation angle of the polygon through text boxes, visualize the polygon in a picture box, and rotate it as needed. The program also supports setting random values for ease.","archived":false,"fork":false,"pushed_at":"2024-12-21T20:12:33.000Z","size":26467,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T21:31:03.391Z","etag":null,"topics":["create","csharp","forms","picturebox","polygon","window-forms-app","windows-forms"],"latest_commit_sha":null,"homepage":"","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/BeyzaKomish.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-07-03T12:30:37.000Z","updated_at":"2024-07-07T15:24:09.000Z","dependencies_parsed_at":"2025-01-29T21:37:25.594Z","dependency_job_id":null,"html_url":"https://github.com/BeyzaKomish/C-Sharp-Create-Polygon_Project","commit_stats":null,"previous_names":["aloramercer/c-sharp-create-polygon_project","beyzakomish/c-sharp-create-polygon_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeyzaKomish%2FC-Sharp-Create-Polygon_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeyzaKomish%2FC-Sharp-Create-Polygon_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeyzaKomish%2FC-Sharp-Create-Polygon_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeyzaKomish%2FC-Sharp-Create-Polygon_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeyzaKomish","download_url":"https://codeload.github.com/BeyzaKomish/C-Sharp-Create-Polygon_Project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239796868,"owners_count":19698576,"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":["create","csharp","forms","picturebox","polygon","window-forms-app","windows-forms"],"created_at":"2024-09-24T14:12:45.587Z","updated_at":"2026-02-06T17:30:19.316Z","avatar_url":"https://github.com/BeyzaKomish.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polygon Drawer and Rotator\n\n## Overview\nThis C# program allows users to create and manipulate polygons using a graphical user interface. The program consists of two main classes, `Point2D` and `Polygon`, and provides functionality to create, draw, and rotate polygons on a form. Users can input the center point, length, number of edges, and rotation angle of the polygon through text boxes, and visualize the polygon in a picture box.\n\n## Classes\n\n### Point2D Class\n- **Data Members**: Cartesian coordinates (x and y)\n- **Properties**: Accessor properties for x and y\n- **Constructors**:\n  - Default constructor\n  - Constructor that sets initial 2D coordinates with random x and y values\n- **Methods**:\n  - `printCoordinates()`: Prints the coordinates of the 2D point\n  - `calculatePolarCoordinates()`: Calculates polar coordinates (P(r,θ)) of the 2D point\n  - `calculateCartesianCoordinates()`: Calculates Cartesian coordinates (P(x,y)) from polar coordinates\n  - `printPolarCoordinates()`: Prints the pre-calculated polar coordinates of the 2D point\n\n### Polygon Class\n- **Data Members**: Center (Point2D), length, number of edges\n- **Properties**: Accessor properties for length and number of edges\n- **Constructors**:\n  - Default constructor\n  - Constructor that takes initial center and length as parameters\n- **Methods**:\n  - `calculateEdgeCoordinates()`: Calculates the vertex points of the polygon starting from a random point\n  - `rotatePolygon()`: Recalculates the vertex points of the polygon in a clockwise direction\n\n## GUI Elements\n- **TextBoxes**:\n  - Center of the polygon (range for x: [0,3], range for y: [0,3], default: (0,0))\n  - Length of the polygon (range: [3-9], default: 4)\n  - Number of edges of the polygon (range: [3-10], default: 5)\n  - Angle of rotation (range: [0-359], default: 30)\n- **ListBox**: Displays the edge coordinates in order\n- **PictureBox**: Draws the graphics of the polygon\n  - The center point of the polygon is the midpoint of the PictureBox\n- **Buttons**:\n  - **Draw Polygon**: \n    - Creates a polygon object based on the text box values (rotation angle is zero for the first draw)\n    - Recalculates the edge coordinates\n    - Draws the polygon in the PictureBox and lists the edge coordinates in the ListBox\n  - **Rotate Polygon**: \n    - Rotates the drawn polygon based on the entered angle\n    - Does nothing or gives a warning if no polygon is drawn\n  - **Set Random Values**: Sets random values on all text boxes\n\n## Usage\n\n1. **Run the Program**: \n   - Open the project in your preferred C# IDE (e.g., Visual Studio).\n   - Build and run the solution.\n\n2. **Interface**:\n   - Enter values for the center point, length, number of edges, and rotation angle in the respective text boxes.\n   - Click \"Draw Polygon\" to create and draw the polygon.\n   - The edge coordinates will be displayed in the ListBox.\n   - Click \"Rotate Polygon\" to rotate the polygon based on the entered angle.\n   - Click \"Set Random Values\" to populate the text boxes with random values.\n\n## Notes\n- Default and random values are provided for ease of use. If these values cause issues, feel free to use alternative values.\n- The program uses the midpoint of the PictureBox as the center point for drawing the polygon.\n\n## ! Please check the Instruction file for more information. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeyzaKomish%2FC-Sharp-Create-Polygon_Project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBeyzaKomish%2FC-Sharp-Create-Polygon_Project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeyzaKomish%2FC-Sharp-Create-Polygon_Project/lists"}