{"id":27954426,"url":"https://github.com/ebu/adm_coordinate_conversion","last_synced_at":"2025-05-07T17:29:23.417Z","repository":{"id":277012132,"uuid":"931000465","full_name":"ebu/adm_coordinate_conversion","owner":"ebu","description":"A C++ library for converting between polar and Cartesian coordinates used in ADM metadata, as specified by ITU-R BS.2127-0.","archived":false,"fork":false,"pushed_at":"2025-02-11T16:34:01.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T17:34:57.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/ebu.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":"2025-02-11T15:04:26.000Z","updated_at":"2025-02-11T16:25:38.000Z","dependencies_parsed_at":"2025-02-12T00:15:23.730Z","dependency_job_id":null,"html_url":"https://github.com/ebu/adm_coordinate_conversion","commit_stats":null,"previous_names":["ebu/adm_coordinate_conversion"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Fadm_coordinate_conversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Fadm_coordinate_conversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Fadm_coordinate_conversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Fadm_coordinate_conversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebu","download_url":"https://codeload.github.com/ebu/adm_coordinate_conversion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252926170,"owners_count":21826256,"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":"2025-05-07T17:29:22.570Z","updated_at":"2025-05-07T17:29:23.398Z","avatar_url":"https://github.com/ebu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ADM Coordinate Conversion Library\n\nA C++ library for converting between polar and Cartesian coordinates used in ADM metadata, as specified by ITU-R BS.2127-0.\n\n## Usage\n\nCMake support has been provided. The library can be built as a static (default) or shared library using the CMake `BUILD_SHARED_LIBS` variable. \n\nTests are also included. These can be built using the `BUILD_TESTS` variable, which is off by default. Catch2 is used as the testing framework and is included as a submodule of this repository.\n\nAll of the exposed functions and types are declared in `include/adm_coord_conv/adm_coord_conv.hpp` and are fairly self explanatory.\n\n### Examples\n\nTo convert only position coordinates, the simpliest solution is;\n\n```\n// Polar to Cartesian\n\ndouble azimuth = 0.5;\ndouble elevation = 0.5;\ndouble distance = 1.0;\n\nCartesianPosition cart = convert(PolarPosition{azimuth, elevation, distance});\n\nstd::cout \u003c\u003c \"X:\" \u003c\u003c cart.x \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Y:\" \u003c\u003c cart.y \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Z:\" \u003c\u003c cart.z \u003c\u003c \"\\n\";\n```\n\n```\n// Cartesian to Polar\n\ndouble x = 0.5;\ndouble y = -0.5;\ndouble z = 0.0;\n\nPolarPosition polar = convert(CartesianPosition{x, y, z});\n\nstd::cout \u003c\u003c \"Azimuth:\" \u003c\u003c polar.azimuth \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Elevation:\" \u003c\u003c polar.elevation \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Distance:\" \u003c\u003c polar.distance \u003c\u003c \"\\n\";\n```\n\nTo convert position coordinates along with extent;\n\n```\n// Polar to Cartesian with Extent\n\ndouble azimuth = 0.5;\ndouble elevation = 0.5;\ndouble distance = 1.0;\ndouble extentWidth = 0.5;\ndouble extentHeight = 0.5;\ndouble extentDepth = 0.5;\n\nCartesianSource cart = convert(\n    PolarPosition{azimuth, elevation, distance},\n    PolarExtent{extentWidth, extentHeight, extentDepth}\n);\n\nstd::cout \u003c\u003c \"Position X:\" \u003c\u003c cart.position.x \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Position Y:\" \u003c\u003c cart.position.y \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Position Z:\" \u003c\u003c cart.position.z \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent X:\" \u003c\u003c cart.extent-\u003ex \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent Y:\" \u003c\u003c cart.extent-\u003ey \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent Z:\" \u003c\u003c cart.extent-\u003ez \u003c\u003c \"\\n\";\n```\n\n```\n// Cartesian to Polar with Extent\n\ndouble positionX = 1.0;\ndouble positionY = -1.0;\ndouble positionZ = 0.0;\ndouble extentX = 0.5;\ndouble extentY = 0.5;\ndouble extentZ = 0.5;\n\nPolarSource polar = convert(\n    CartesianPosition{positionX, positionY, positionZ},\n    CartesianExtent{extentX, extentY, extentZ}\n);\n\nstd::cout \u003c\u003c \"Position Azimuth:\" \u003c\u003c polar.position.x \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Position Elevation:\" \u003c\u003c polar.position.y \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Position Distance:\" \u003c\u003c polar.position.z \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent Width:\" \u003c\u003c polar.extent-\u003ewidth \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent Height:\" \u003c\u003c polar.extent-\u003eheight \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"Extent Depth:\" \u003c\u003c polar.extent-\u003edepth \u003c\u003c \"\\n\";\n```\n\nThe `convert` method can also be called directly with a `PolarSource` or `CartesianSource` struct, both of which support optional extent data.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febu%2Fadm_coordinate_conversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febu%2Fadm_coordinate_conversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febu%2Fadm_coordinate_conversion/lists"}