{"id":16266471,"url":"https://github.com/thormeier/gyro-plane","last_synced_at":"2025-03-19T23:30:43.542Z","repository":{"id":57259886,"uuid":"157590378","full_name":"thormeier/gyro-plane","owner":"thormeier","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-14T18:24:10.000Z","size":3,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T11:55:01.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/thormeier.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}},"created_at":"2018-11-14T18:07:39.000Z","updated_at":"2024-09-21T06:46:31.000Z","dependencies_parsed_at":"2022-08-25T01:51:13.012Z","dependency_job_id":null,"html_url":"https://github.com/thormeier/gyro-plane","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2Fgyro-plane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2Fgyro-plane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2Fgyro-plane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2Fgyro-plane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thormeier","download_url":"https://codeload.github.com/thormeier/gyro-plane/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244524554,"owners_count":20466450,"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":[],"created_at":"2024-10-10T17:42:04.601Z","updated_at":"2025-03-19T23:30:43.250Z","avatar_url":"https://github.com/thormeier.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GyroPlane - Project angles from a gyroscope onto a 2D plane.\n\nThis library provides a way to project 3D angles from a gyroscope (e.g. from a\nsmartphone) onto a 2D plane. Basically it \"converts\" the alpha and beta values\nto x and y coordinates.\n\nThe library needs to be aware of the plane size (in pixels) and the distance\nbetween the center of the plane and the center of the gyroscope. The distance\nis also defined in pixels.\n\n## How to use\n\n```javascript\nimport { GyroPlane } from 'gyro-plane'\n\nconst width = window.innerWidth\nconst height = window.innerHeight\n\n// Assume the distance between gyroscope and screen to be two times the width\nconst distance = width * 2\n\nlet gyro = new GyroPlane({\n  width: window.innerWidth,\n  height: window.innerHeight,\n  distance: distance\n})\n\n// Update the orientation values from a gyroscope.\ngyro.updateOrientation({ alpha: 30, beta: -25.6 })\n\n// To get the calculated coordinates, you have to call this function.\nconst coordinates = gyro.getScreenCoordinates()\n// =\u003e { x: 80, y: 130 }\n```\n\n## Todo\n- docs\n- tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthormeier%2Fgyro-plane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthormeier%2Fgyro-plane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthormeier%2Fgyro-plane/lists"}