{"id":22402771,"url":"https://github.com/open-space-collective/open-space-toolkit-mathematics","last_synced_at":"2025-04-10T01:12:28.319Z","repository":{"id":33010736,"uuid":"136834880","full_name":"open-space-collective/open-space-toolkit-mathematics","owner":"open-space-collective","description":"Geometry, curve fitting, optimization.","archived":false,"fork":false,"pushed_at":"2025-02-22T16:54:27.000Z","size":22703,"stargazers_count":19,"open_issues_count":10,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-10T01:12:18.703Z","etag":null,"topics":["cpp","engineering","mathematics","python","space","toolkit"],"latest_commit_sha":null,"homepage":"https://open-space-collective.github.io/open-space-toolkit-mathematics/","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/open-space-collective.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-06-10T18:35:03.000Z","updated_at":"2025-02-22T16:54:30.000Z","dependencies_parsed_at":"2023-01-14T23:02:18.206Z","dependency_job_id":"dcb244bb-44ea-490a-b516-4db05ecf425d","html_url":"https://github.com/open-space-collective/open-space-toolkit-mathematics","commit_stats":{"total_commits":240,"total_committers":7,"mean_commits":"34.285714285714285","dds":"0.21250000000000002","last_synced_commit":"78ce2064e7b1ccd1fa2b220408748cb1da4bfca4"},"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-space-collective%2Fopen-space-toolkit-mathematics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-space-collective%2Fopen-space-toolkit-mathematics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-space-collective%2Fopen-space-toolkit-mathematics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-space-collective%2Fopen-space-toolkit-mathematics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-space-collective","download_url":"https://codeload.github.com/open-space-collective/open-space-toolkit-mathematics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137890,"owners_count":21053775,"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":["cpp","engineering","mathematics","python","space","toolkit"],"created_at":"2024-12-05T09:14:17.902Z","updated_at":"2025-04-10T01:12:28.298Z","avatar_url":"https://github.com/open-space-collective.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Space Toolkit ▸ Mathematics\n\n[![Build and Test](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/build-test.yml/badge.svg?branch=main)](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/build-test.yml)\n[![Release](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/release.yml/badge.svg)](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/release.yml)\n[![Code Coverage](https://codecov.io/gh/open-space-collective/open-space-toolkit-mathematics/branch/main/graph/badge.svg)](https://codecov.io/gh/open-space-collective/open-space-toolkit-mathematics)\n[![Documentation](https://img.shields.io/readthedocs/pip/stable.svg)](https://open-space-collective.github.io/open-space-toolkit-mathematics)\n[![GitHub version](https://badge.fury.io/gh/open-space-collective%2Fopen-space-toolkit-mathematics.svg)](https://badge.fury.io/gh/open-space-collective%2Fopen-space-toolkit-mathematics)\n[![PyPI version](https://badge.fury.io/py/open-space-toolkit-mathematics.svg)](https://badge.fury.io/py/open-space-toolkit-mathematics)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nGeometry, curve fitting, optimization.\n\n## Getting Started\n\nWant to get started? This is the simplest and quickest way:\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-space-collective/open-space-toolkit/main?urlpath=lab/tree/notebooks)\n\n*Nothing to download or install! This will automatically start a [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) environment in your browser with Open Space Toolkit libraries and example notebooks ready to use.*\n\n### Alternatives\n\n#### Docker Images\n\n[Docker](https://www.docker.com/) must be installed on your system.\n\n##### iPython\n\nThe following command will start an [iPython](https://ipython.org/) shell within a container where the OSTk components are already installed:\n\n```bash\ndocker run -it openspacecollective/open-space-toolkit-mathematics-development python3.11 -m IPython\n```\n\nOnce the shell is up and running, playing with it is easy:\n\n```py\nimport numpy\nfrom ostk.mathematics.geometry import Angle\nfrom ostk.mathematics.geometry.d3.transformation.rotation import Quaternion\nfrom ostk.mathematics.geometry.d3.transformation.rotation import RotationVector\n\nrv = RotationVector(numpy.array([[0.0], [0.0], [1.0]], dtype=float), Angle.degrees(15.0)) # Construct rotation vector\n\nq_AB = Quaternion(1.0, 2.0, 3.0, 4.0, Quaternion.Format.XYZS).to_normalized() # Construct quaternion and normalize\nq_BC = Quaternion.rotation_vector(rv) # Construct quaternion from rotation vector\n\nq_AC = q_AB * q_BC # Multiply quaternions\n```\n\n*Tip: Use tab for auto-completion!*\n\n##### JupyterLab\n\nThe following command will start a [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) server within a container where the OSTk components are already installed:\n\n```bash\ndocker run --publish=8888:8888 openspacecollective/open-space-toolkit-mathematics-jupyter\n```\n\nOnce the container is running, access [http://localhost:8888/lab](http://localhost:8888/lab) and create a Python 3 Notebook.\n\n## Installation\n\n### C++\n\nThe binary packages are hosted using [GitHub Releases](https://github.com/open-space-collective/open-space-toolkit-mathematics/releases):\n\n- Runtime libraries: `open-space-toolkit-mathematics-X.Y.Z-1.x86_64-runtime`\n- C++ headers: `open-space-toolkit-mathematics-X.Y.Z-1.x86_64-devel`\n- Python bindings: `open-space-toolkit-mathematics-X.Y.Z-1.x86_64-python`\n\n#### Debian / Ubuntu\n\nAfter downloading the relevant `.deb` binary packages, install:\n\n```bash\napt install open-space-toolkit-mathematics-*.deb\n```\n\n### Python\n\nInstall from [PyPI](https://pypi.org/project/open-space-toolkit-mathematics/):\n\n```bash\npip install open-space-toolkit-mathematics\n```\n\n## Documentation\n\nDocumentation is available here:\n\n- [C++](https://open-space-collective.github.io/open-space-toolkit-mathematics)\n- [Python](./bindings/python/docs)\n\n\u003cdetails\u003e\n\u003csummary\u003eStructure\u003c/summary\u003e\n\u003cp\u003e\n\nThe library exhibits the following structure:\n\n```txt\n├── Object\n│   ├── Vector\n│   ├── Matrix\n│   └── Interval\n├── Geometry\n│   ├── 2D\n|   │   ├── Object\n│   │   │   ├── Point\n│   │   │   ├── Point Set\n│   │   │   ├── Line\n│   │   │   ├── Line String\n│   │   │   ├── Multi Line String\n│   │   │   └── Polygon\n│   │   ├── Intersection\n│   │   └── Transformation\n│   │       ├── Identity\n│   │       ├── Translation\n│   │       ├── Rotation\n│   │       ├── Reflection\n│   │       ├── Scaling\n│   │       └── Shear\n│   ├── 3D\n|   │   ├── Object\n│   │   │   ├── Point\n│   │   │   ├── Point Set\n│   │   │   ├── Line\n│   │   │   ├── Ray\n│   │   │   ├── Segment\n│   │   │   ├── Line String\n│   │   │   ├── Polygon\n│   │   │   ├── Plane\n│   │   │   ├── Cuboid\n│   │   │   ├── Sphere\n│   │   │   ├── Ellipsoid\n│   │   │   ├── Cone\n│   │   │   ├── Pyramid\n│   │   │   └── Composite\n│   │   ├── Intersection\n│   │   └── Transformation\n│   │       ├── Identity\n│   │       ├── Translation\n│   │       ├── Rotation\n│   │       │   ├── Quaternion\n│   │       │   ├── Euler Angle\n│   │       │   ├── Rotation Vector\n│   │       │   └── Rotation Matrix\n│   │       ├── Reflection\n│   │       ├── Scaling\n│   │       └── Shear\n├── Dynamics\n│   ├── State\n│   ├── Solver\n│   │   ├── Runge–Kutta 4 (RK4)\n│   │   ├── Dormand–Prince 5 (DP5)\n│   │   └── Runge–Kutta–Fehlberg 78 (F78)\n│   └── Systems\n├── Curve Fitting\n│   ├── Interpolator\n│   │   ├── Linear\n│   │   ├── Barycentric Rational\n│   │   ├── Cubic Spline\n│   │   └── Lagrange\n│   └── Smoothing\n├── Optimization\n│   ├── Problem\n│   └── Algorithms\n│       ├── Gradient Descent\n│       └── Evolutionary\n│           ├── Genetic\n│           ├── Differential Evolution\n│           └── Swarm\n└── Statistics\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Tutorials\n\nTutorials are available here:\n\n- [C++](./tutorials/cpp)\n- [Python](./tutorials/python)\n\n## Features\n\n### Geometry Queries\n\n- `○`: query only\n- `✔`: query / intersection set\n- ` `: to be implemented\n- `-`: undefined\n\n#### 3D\n\n| Intersect       | Point | Point Set | Line | Ray | Segment | Line String | Polygon | Plane | Cuboid | Sphere | Ellipsoid | Cone | Pyramid | Composite |\n| --------------- | ----- | --------- | ---- | --- | ------- | ----------- | ------- | ----- | ------ | ------ | --------- | ---- | ------- | --------- |\n| **Point**       |       |           | ○    | ○   |         |             |         | ✔     | ○      | ○      | ○         |      |         |           |\n| **Point Set**   |       |           |      |     |         |             |         | ✔     | ○      | ○      | ○         |      |         |           |\n| **Line**        | ○     |           |      |     |         |             |         | ✔     | ○      | ○      | ✔         |      |         |           |\n| **Ray**         | ○     |           |      |     |         |             |         | ✔     |        | ○      | ✔         |      |         |           |\n| **Segment**     |       |           |      |     |         |             |         | ✔     |        | ○      | ✔         |      |         |           |\n| **Line String** |       |           |      |     |         |             |         |       |        |        |           |      |         |           |\n| **Polygon**     |       |           |      |     |         |             |         |       |        |        |           |      |         |           |\n| **Plane**       | ✔     | ✔         | ✔    | ✔   | ✔       |             |         |       |        | ○      | ○         |      |         |           |\n| **Cuboid**      | ○     | ○         | ○    |     |         |             |         |       |        |        |           |      |         |           |\n| **Sphere**      | ○     | ○         | ○    | ○   | ○       |             |         | ○     |        |        |           |      | ○       |           |\n| **Ellipsoid**   | ○     | ○         | ✔    | ✔   | ✔       |             |         | ○     |        |        |           | ✔    | ✔       |           |\n| **Cone**        |       |           |      |     |         |             |         |       |        |        | ✔         |      |         |           |\n| **Pyramid**     |       |           |      |     |         |             |         |       |        | ○      | ✔         |      |         |           |\n| **Composite**   |       |           |      |     |         |             |         |       |        |        |           |      |         |           |\n\n| Contain         | Point | Point Set | Line | Ray | Segment | Line String | Polygon | Plane | Cuboid | Sphere | Ellipsoid | Cone | Pyramid | Composite |\n| --------------- | ----- | --------- | ---- | --- | ------- | ----------- | ------- | ----- | ------ | ------ | --------- | ---- | ------- | --------- |\n| **Point**       |       |           | -    | -   | -       | -           | -       | -     | -      | -      | -         | -    | -       |           |\n| **Point Set**   |       |           | -    | -   | -       | -           | -       | -     | -      | -      | -         | -    | -       |           |\n| **Line**        | ✔     |           |      |     |         |             | -       | -     | -      | -      | -         | -    | -       |           |\n| **Ray**         | ✔     | ✔         | -    |     |         |             | -       | -     | -      | -      | -         | -    | -       |           |\n| **Segment**     | ✔     |           | -    | -   |         |             | -       | -     | -      | -      | -         | -    | -       |           |\n| **Line String** |       |           | -    | -   |         |             | -       | -     | -      | -      | -         | -    | -       |           |\n| **Polygon**     |       |           | -    | -   |         |             |         | -     | -      | -      | -         | -    | -       |           |\n| **Plane**       | ✔     | ✔         | ✔    | ✔   | ✔       |             |         |       | -      | -      | -         | -    | -       |           |\n| **Cuboid**      | ✔     | ✔         | -    | -   |         |             |         | -     |        |        |           |      |         |           |\n| **Sphere**      | ✔     | ✔         | -    | -   | -       | -           | -       | -     |        |        |           |      |         |           |\n| **Ellipsoid**   | ✔     | ✔         | -    | -   | -       | -           | -       | -     |        |        |           |      |         |           |\n| **Cone**        |       |           |      |     |         | -           | -       | -     |        |        |           |      |         |           |\n| **Pyramid**     | ✔     |           |      |     |         |             |         | -     |        |        |           |      |         |           |\n| **Composite**   |       |           |      |     |         |             |         |       |        |        |           |      |         |           |\n\n## Setup\n\n### Development Environment\n\nUsing [Docker](https://www.docker.com) for development is recommended, to simplify the installation of the necessary build tools and dependencies.\nInstructions on how to install Docker are available [here](https://docs.docker.com/install/).\n\nTo start the development environment:\n\n```bash\nmake start-development\n```\n\nThis will:\n\n1. Build the `openspacecollective/open-space-toolkit-mathematics-development` Docker image.\n2. Create a development environment container with local source files and helper scripts mounted.\n3. Start a `bash` shell from the `./build` working directory.\n\nIf installing Docker is not an option, you can manually install the development tools (GCC, CMake) and all required dependencies,\nby following a procedure similar to the one described in the [Development Dockerfile](./docker/development/Dockerfile).\n\n### Build\n\nFrom the `./build` directory:\n\n```bash\ncmake ..\nmake\n```\n\n*Tip: `ostk-build` simplifies building from within the development environment.*\n\n### Test\n\nTo start a container to build and run the tests:\n\n```bash\nmake test\n```\n\nOr to run them manually:\n\n```bash\n./bin/open-space-toolkit-mathematics.test\n```\n\n*Tip: `ostk-test` simplifies running tests from within the development environment.*\n\n## Dependencies\n\n| Name                   | Version  | License                | Link                                                                                                                         |\n| ---------------------- | -------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| Pybind11               | `2.12.0` | BSD-3-Clause           | [github.com/pybind/pybind11](https://github.com/pybind/pybind11)                                                             |\n| Eigen                  | `3.3.7`  | MPL2                   | [eigen.tuxfamily.org](http://eigen.tuxfamily.org/index.php)                                                                  |\n| Geometric Tools Engine | `3.28`   | Boost Software License | [geometrictools.com](https://www.geometrictools.com)                                                                         |\n| Core                   | `main`   | Apache License 2.0     | [github.com/open-space-collective/open-space-toolkit-core](https://github.com/open-space-collective/open-space-toolkit-core) |\n\n## Contribution\n\nContributions are more than welcome!\n\nPlease read our [contributing guide](CONTRIBUTING.md) to learn about our development process, how to propose fixes and improvements, and how to build and test the code.\n\n## Special Thanks\n\n[![Loft Orbital](https://github.com/open-space-collective/open-space-toolkit/blob/main/assets/thanks/loft_orbital.png)](https://www.loftorbital.com/)\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-space-collective%2Fopen-space-toolkit-mathematics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-space-collective%2Fopen-space-toolkit-mathematics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-space-collective%2Fopen-space-toolkit-mathematics/lists"}