{"id":29205692,"url":"https://github.com/sudo-arash/sincos2angle","last_synced_at":"2026-02-01T20:36:36.811Z","repository":{"id":301569379,"uuid":"1009673975","full_name":"sudo-arash/sincos2angle","owner":"sudo-arash","description":"Convert sin and cos to an angle using neural networks in MATLAB.","archived":false,"fork":false,"pushed_at":"2025-06-27T14:37:31.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T15:33:24.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudo-arash.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,"zenodo":null}},"created_at":"2025-06-27T14:16:21.000Z","updated_at":"2025-06-27T14:37:35.000Z","dependencies_parsed_at":"2025-06-27T15:35:32.999Z","dependency_job_id":"9bf5149f-9c4a-44e5-96cc-14d2e58e8e9c","html_url":"https://github.com/sudo-arash/sincos2angle","commit_stats":null,"previous_names":["sudo-arash/sincos2angle"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sudo-arash/sincos2angle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsincos2angle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsincos2angle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsincos2angle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsincos2angle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudo-arash","download_url":"https://codeload.github.com/sudo-arash/sincos2angle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsincos2angle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28989365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: 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":[],"created_at":"2025-07-02T16:39:37.041Z","updated_at":"2026-02-01T20:36:36.795Z","avatar_url":"https://github.com/sudo-arash.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# [sin, cos] =\u003e angle\nConvert sin and cos to an angle using neural networks in MATLAB.\n\n## How to use\nFirst, load the network using this command:\n```matlab\nload(\"network.mat\");\n```\nThen, you need to give it sin and cos of the angle you want! But, you have to first convert angle to radians:\n```matlab\nangle = 30;\ninputs = [sin(deg2rad(angle)), cos(dregrad(angle))];\n```\nAnd now, we use the `net` function:\n```matlab\nnet(inputs)\n```\n\n## Training\nWe had a dataset of about 10,000 inputs and outputs which were like this:\n```matlab\noutputs = linspace(0, 359, 10000); % We didn't train the network to do 360 degree or negative degrees.\ninputs = [sin(deg2rad(a)), cos(dregrad(a))];\n% and then we setup the network and used the train function to train it.\ntrain(net, inputs, outputs);\n```\n\n## Layers\nWe first thought one hidden layer does the job, but it still failed the validation tests. So, we changed it to 2. The first layer has about 15 neurons while the second has 10. This gave better results.\n\n## Limitations\nYou can give it negative angles or angles bigger than 359. This is because of the fact that we couldn't train the network to learn 0 or 360 degrees, that would change it's behaviour completely.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-arash%2Fsincos2angle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudo-arash%2Fsincos2angle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-arash%2Fsincos2angle/lists"}