Geometry, curve fitting, optimization.
Want to get started? This is the simplest and quickest way:
Nothing to download or install! This will automatically start a JupyterLab environment in your browser with Open Space Toolkit libraries and example notebooks ready to use.
Docker must be installed on your system.
The following command will start an iPython shell within a container where the OSTk components are already installed:
docker run -it openspacecollective/open-space-toolkit-mathematics-python
Once the shell is up and running, playing with it is easy:
import numpy
from ostk.mathematics.geometry import Angle
from ostk.mathematics.geometry.d3.transformation.rotation import Quaternion
from ostk.mathematics.geometry.d3.transformation.rotation import RotationVector
rv = RotationVector(numpy.array([[0.0], [0.0], [1.0]], dtype=float), Angle.degrees(15.0)) # Construct rotation vector
q_AB = Quaternion(1.0, 2.0, 3.0, 4.0, Quaternion.Format.XYZS).to_normalized() # Construct quaternion and normalize
q_BC = Quaternion.rotation_vector(rv) # Construct quaternion from rotation vector
q_AC = q_AB * q_BC # Multiply quaternions
Tip: Use tab for auto-completion!
The following command will start a JupyterLab server within a container where the OSTk components are already installed:
docker run --publish=8888:8888 openspacecollective/open-space-toolkit-mathematics-jupyter
Once the container is running, access http://localhost:8888/lab and create a Python 3 Notebook.
The binary packages are hosted using GitHub Releases:
- Runtime libraries:
open-space-toolkit-mathematics-X.Y.Z-1.x86_64-runtime
- C++ headers:
open-space-toolkit-mathematics-X.Y.Z-1.x86_64-devel
- Python bindings:
open-space-toolkit-mathematics-X.Y.Z-1.x86_64-python
After downloading the relevant .deb
binary packages, install:
apt install open-space-toolkit-mathematics-*.deb
Install from PyPI:
pip install open-space-toolkit-mathematics
Documentation is available here:
Structure
The library exhibits the following structure:
βββ Object
β βββ Vector
β βββ Matrix
β βββ Interval
βββ Geometry
β βββ 2D
| β βββ Object
β β β βββ Point
β β β βββ Point Set
β β β βββ Line
β β β βββ Line String
β β β βββ Multi Line String
β β β βββ Polygon
β β βββ Intersection
β β βββ Transformation
β β βββ Identity
β β βββ Translation
β β βββ Rotation
β β βββ Reflection
β β βββ Scaling
β β βββ Shear
β βββ 3D
| β βββ Object
β β β βββ Point
β β β βββ Point Set
β β β βββ Line
β β β βββ Ray
β β β βββ Segment
β β β βββ Line String
β β β βββ Polygon
β β β βββ Plane
β β β βββ Cuboid
β β β βββ Sphere
β β β βββ Ellipsoid
β β β βββ Cone
β β β βββ Pyramid
β β β βββ Composite
β β βββ Intersection
β β βββ Transformation
β β βββ Identity
β β βββ Translation
β β βββ Rotation
β β β βββ Quaternion
β β β βββ Euler Angle
β β β βββ Rotation Vector
β β β βββ Rotation Matrix
β β βββ Reflection
β β βββ Scaling
β β βββ Shear
βββ Dynamics
β βββ State
β βββ Solver
β β βββ RungeβKutta 4 (RK4)
β β βββ DormandβPrince 5 (DP5)
β β βββ RungeβKuttaβFehlberg 78 (F78)
β βββ Systems
βββ Curve Fitting
β βββ Interpolator
β β βββ Linear
β β βββ Barycentric Rational
β β βββ Cubic Spline
β β βββ Lagrange
β βββ Smoothing
βββ Optimization
β βββ Problem
β βββ Algorithms
β βββ Gradient Descent
β βββ Evolutionary
β βββ Genetic
β βββ Differential Evolution
β βββ Swarm
βββ Statistics
Tutorials are available here:
-
β
: query only -
β
: query / intersection set -
-
-
: undefined
Intersect | Point | Point Set | Line | Ray | Segment | Line String | Polygon | Plane | Cuboid | Sphere | Ellipsoid | Cone | Pyramid | Composite |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Point | β | β | β | β | β | β | ||||||||
Point Set | β | β | β | β | ||||||||||
Line | β | β | β | β | β | |||||||||
Ray | β | β | β | β | ||||||||||
Segment | β | β | β | |||||||||||
Line String | ||||||||||||||
Polygon | ||||||||||||||
Plane | β | β | β | β | β | β | β | |||||||
Cuboid | β | β | β | |||||||||||
Sphere | β | β | β | β | β | β | β | |||||||
Ellipsoid | β | β | β | β | β | β | β | β | ||||||
Cone | β | |||||||||||||
Pyramid | β | β | ||||||||||||
Composite |
Contain | Point | Point Set | Line | Ray | Segment | Line String | Polygon | Plane | Cuboid | Sphere | Ellipsoid | Cone | Pyramid | Composite |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Point | - | - | - | - | - | - | - | - | - | - | - | |||
Point Set | - | - | - | - | - | - | - | - | - | - | - | |||
Line | β | - | - | - | - | - | - | - | ||||||
Ray | β | β | - | - | - | - | - | - | - | - | ||||
Segment | β | - | - | - | - | - | - | - | - | - | ||||
Line String | - | - | - | - | - | - | - | - | - | |||||
Polygon | - | - | - | - | - | - | - | - | ||||||
Plane | β | β | β | β | β | - | - | - | - | - | ||||
Cuboid | β | β | - | - | - | |||||||||
Sphere | β | β | - | - | - | - | - | - | ||||||
Ellipsoid | β | β | - | - | - | - | - | - | ||||||
Cone | - | - | - | |||||||||||
Pyramid | β | - | ||||||||||||
Composite |
Using Docker for development is recommended, to simplify the installation of the necessary build tools and dependencies. Instructions on how to install Docker are available here.
To start the development environment:
make start-development
This will:
- Build the
openspacecollective/open-space-toolkit-mathematics-development
Docker image. - Create a development environment container with local source files and helper scripts mounted.
- Start a
bash
shell from the./build
working directory.
If installing Docker is not an option, you can manually install the development tools (GCC, CMake) and all required dependencies, by following a procedure similar to the one described in the Development Dockerfile.
From the ./build
directory:
cmake ..
make
Tip: helpers/build.sh
simplifies building from within the development environment.
To start a container to build and run the tests:
make test
Or to run them manually:
./bin/open-space-toolkit-mathematics.test
Tip: helpers/test.sh
simplifies running tests from within the development environment.
Name | Version | License | Link |
---|---|---|---|
Pybind11 | 2.10.1 |
BSD-3-Clause | github.com/pybind/pybind11 |
{fmt} | 5.2.0 |
BSD-2-Clause | github.com/fmtlib/fmt |
Eigen | 3.3.7 |
MPL2 | eigen.tuxfamily.org |
Geometric Tools Engine | 3.28 |
Boost Software License | geometrictools.com |
Core | main |
Apache License 2.0 | github.com/open-space-collective/open-space-toolkit-core |
Contributions are more than welcome!
Please read our contributing guide to learn about our development process, how to propose fixes and improvements, and how to build and test the code.
Apache License 2.0