This library snapps points that are ε-close to the sphere to rational points that are no more than 2ε away from the closest point on the sphere. It is based on the paper Rational Points on the Unit Sphere: Approximation Complexity and Practical Constructions
- gmpxx
- mpfr
- git clone --recursive https://github.com/fmi-alg/libratss.git libratss
- cd libratss && mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=lto ../
- cd ratsstools && make
- Build the tools
- ./proj -h
- Build the tools
- ./rndpoints -h
- Build the tools
- ./rndpoints -g nplane -f geo -d 3 -n 1000 | ./proj -b -r cf -s plane -if geo -of rational -p 128 -e 53
- Build the tools
- ./rndpoints -g nplane -f geo -d 3 -n 1000 | ./proj -b -r cf -s plane -if geo -of rational -p 128 -e 53 -o 1ksnapped
- gnuplot -e 'splot "1ksnapped" using ($1/$2):($3/$4):($5/$6); pause mouse keypres;'
- add the repository to your project
- make sure to add the appropriate compile definitions to your project. If you're using CMake and you're adding libratss as a subdirectory then these are exported. See the CMakeLists.txt for a list of exported variables.
- add <libratss/ProjectSN.h> or <libratss/ProjectS2.h> as include
libratss is licensed under LGPL v2.1. Since libratss links with mpfr, mpfr C++, gmp, gmpxx and cgal the resulting binaries are usually governed by the GPL v3