{"id":16591088,"url":"https://github.com/alex-page/harmonograph-xy","last_synced_at":"2025-06-30T09:34:57.468Z","repository":{"id":42680327,"uuid":"260590366","full_name":"alex-page/harmonograph-xy","owner":"alex-page","description":"👩‍🎨 Generate a harmonographs X and Y coordinates","archived":false,"fork":false,"pushed_at":"2023-07-18T21:58:37.000Z","size":530,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-20T16:54:58.610Z","etag":null,"topics":["algorithmic-design","geometric-algorithms","harmonograph","javascript","lissajous-curve","nodejs"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@harmonograph/xy","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/alex-page.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":"2020-05-02T01:12:02.000Z","updated_at":"2021-10-12T15:57:13.000Z","dependencies_parsed_at":"2025-02-14T07:31:57.643Z","dependency_job_id":"f0c11d14-8796-436e-9397-44d279b1d477","html_url":"https://github.com/alex-page/harmonograph-xy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alex-page/harmonograph-xy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-page%2Fharmonograph-xy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-page%2Fharmonograph-xy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-page%2Fharmonograph-xy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-page%2Fharmonograph-xy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex-page","download_url":"https://codeload.github.com/alex-page/harmonograph-xy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-page%2Fharmonograph-xy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261218421,"owners_count":23126375,"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":["algorithmic-design","geometric-algorithms","harmonograph","javascript","lissajous-curve","nodejs"],"created_at":"2024-10-11T23:15:20.481Z","updated_at":"2025-06-30T09:34:57.440Z","avatar_url":"https://github.com/alex-page.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @harmonograph/xy\n\n\u003e 👩‍🎨 Generate a harmonographs X and Y coordinates\n\n\n## Install\n\n```shell\nnpm install @harmonograph/xy\n```\n\n\n## Get started\n\nThe harmonograph is a mechanical apparatus that uses pendulums to create a geometric image. This function uses the drawing time, size and pendulums to create X and Y coordinates for a harmonograph.\n\nIf you wish to draw the harmonograph for use on a website you can use `@harmonograph/svg`.\n\n\n### Create harmonograph XY coordinates\n\n```js\nconst generateHarmonographXY = require('@harmonograph/xy');\n\nconst harmonograph = generateHarmonographXY(\n  150,\n  700,\n  [{\n    amplitude: 200, frequency: 2.985, phase: 2.054, damping: 0.001\n  },\n  {\n    amplitude: 200, frequency: 3.006, phase: 1.820, damping: 0.008\n  },\n  {\n    amplitude: 200, frequency: 3.003, phase: 2.283, damping: 0.001\n  },\n  {\n    amplitude: 200, frequency: 1.994, phase: 1.155, damping: 0.001\n  }]\n);\n```\n\nThis returns an object containing an array of X and Y coordinates. When drawn these points create a harmonograph.\n\n```js\n{\n  x: [1, 2, 3],\n  y: [1, 3, 9]\n}\n```\n\n\n### Create randomised harmonograph XY coordinates\n\n```js\nconst generateHarmonographXY = require('@harmonograph/xy');\nconst {randomPendulums} = require('@harmonograph/xy');\n\nconst harmonograph = generateHarmonographXY(150, 700, randomPendulums());\n```\n\n\n## Options\n\n| Option | Description | Default value | Type |\n| --- | --- | --- | --- |\n| drawingTime | How long the pendulum swings in seconds | `150` | _number_ |\n| size | The size of the svg | `700` | _number_ |\n| pendulums | Two pendulums require four items ( x, y and x, y ). Each X and Y value is an object that contains _amplitude_, _frequency_, _phase_, and _damping_ ( see pendulum options below ) | `random values` | _array_ |\n\n\n## Pendulums object\n\n| Parameter | Description | Default value | Type |\n| --- | --- | --- | --- |\n| pendulum.amplitude | How far a pendulum swings back and forth, must be from `0` - `360` degrees | `random number` | _number_ |\n| pendulum.frequency | How fast a pendulum swings back and forth, for best results use decimal values around `2` and `3` | `random number` | _number_ |\n| pendulum.phase | The rate that a pendulum loses its energy, or slows down, must be from `0` to `π` | `random number` | _number_ |\n| pendulum.damping | The offset from the normal starting position of a pendulum, must be from `0` to `0.01` | `random number` | _number_ |\n\n\n## Release History\n\n* v0.0.0  - 💥 Initial version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-page%2Fharmonograph-xy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex-page%2Fharmonograph-xy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-page%2Fharmonograph-xy/lists"}