{"id":25603267,"url":"https://github.com/kovzol/realgeom","last_synced_at":"2025-08-14T08:52:21.432Z","repository":{"id":148822310,"uuid":"98743092","full_name":"kovzol/realgeom","owner":"kovzol","description":"Real geometry tools","archived":false,"fork":false,"pushed_at":"2024-01-25T06:56:33.000Z","size":1464,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-01-25T07:39:49.181Z","etag":null,"topics":["benchmark","cas","geometry","giac","java","maple","mathematica","redlog","reduce"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kovzol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-29T15:56:34.000Z","updated_at":"2023-03-17T10:50:13.000Z","dependencies_parsed_at":"2023-06-27T18:34:33.128Z","dependency_job_id":null,"html_url":"https://github.com/kovzol/realgeom","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kovzol%2Frealgeom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kovzol%2Frealgeom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kovzol%2Frealgeom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kovzol%2Frealgeom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kovzol","download_url":"https://codeload.github.com/kovzol/realgeom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240056760,"owners_count":19741196,"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":["benchmark","cas","geometry","giac","java","maple","mathematica","redlog","reduce"],"created_at":"2025-02-21T17:26:05.206Z","updated_at":"2025-02-21T17:26:05.873Z","avatar_url":"https://github.com/kovzol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# realgeom, a tool to solve problems in real geometry #\nThis tool can solve some real geometry problems\nby using several computer algebra systems (CAS)\nby formalizing the problems, analyzing the\nresult, and returning the answer to the user in readable format.\n\nFor example, such a problem is comparing (a²+b²+c²) and (a·b+b·c+c·a) in\na triangle where a, b and c are the lengths of the sides. It can be\nproven that\n\na·b+b·c+c·a ≦ a²+b²+c² \u003c 2·(a·b+b·c+c·a)\n\n**realgeom** is capable of solving this kind of problem (among many others) by using recent computer\nalgebra algorithms from various recent tools. Similar problems have been\nposed by the first chapter of the book\n\n* Bottema, Djordjević, Janić, Mitronović, Vasić:\n  _Geometric inequalities_, Wolters-Noordhoff Publishing, Groningen, The Nederlands (1969)\n\nThe program offers two ways to solve such problems:\n\n* by working as a web service or\n* reading the list of given problems from a CSV file.\n\nAn example database of problems is also available based on\nthe book above. \n\n## Installation ##\n\n![build](https://github.com/kovzol/realgeom/workflows/build/badge.svg)\n\nYou need to have the following pieces of software installed:\n\n* Linux (most distributions should work, for example, Debian 8) or macOS (Catalina 10.15 should work) or Windows 10\n* [Java SE 7/8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)\n\nOptional:\n\n* [Tarski](https://github.com/chriswestbrown/tarski) (recommended for educational uses)\n* [Mathematica](https://www.wolfram.com/mathematica/) (recommended for heavy computations)\n* [QEPCAD](https://www.usna.edu/CS/qepcadweb/B/QEPCAD.html)\n* [Maple](https://www.maplesoft.com/) with the following libraries:\n  * a recent version of [RegularChains](http://www.regularchains.org/) and/or\n  * [SyNRAC](http://www.fujitsu.com/jp/group/labs/en/resources/tech/announced-tools/synrac/)\n* [Reduce](http://www.reduce-algebra.com/) with\n  * [RedLog](http://www.redlog.eu/)\n\n## Usage ##\nThe command `./gradlew installDist` will download and compile\nall additional tools you may\neventually need, or informs you about the further steps.\nFinally the following command will start the program:\n\n    $ ./gradlew run\n\nThis should perform a self-test that results in something like this:\n```\nLoading Giac Java interface...\nTime limit is set to 3600 seconds\nTesting Giac connection...\nTesting shell connection...\nTesting Mathematica connection via shell...\nTesting Maple connection via shell...\nTesting Maple/RegularChains...\nTesting Maple/SyNRAC...\nTesting QEPCAD connection via shell...\nTesting Reduce connection via shell...\nTesting RedLog connection via shell...\nAll required tests are passed\nSupported backends: mathematica,maple/regularchains,maple/synrac,qepcad,redlog\n```\nBy entering\n\n    $ ./gradlew run --args=\"-h\"\n    \nyou will get some help on the command line options:\n```\nLoading Giac Java interface...\nUnrecognized option: -h\nusage: realgeom\n -b,--benchmark         run benchmark\n -c,--backends \u003carg\u003e    backends\n -d,--dry-run           do not run heavy computations \n -g,--geogebra          quickstart for GeoGebra (skips most checks)\n -i,--input \u003carg\u003e       benchmark input file path\n -L,--qepcadL \u003carg\u003e     space for prime list (QEPCAD +L)\n -l,--logfile \u003carg\u003e     filename for logging\n -N,--qepcadN \u003carg\u003e     garbage collected space in cells (QEPCAD +N) \n -o,--output \u003carg\u003e      benchmark output file\n -p,--port \u003carg\u003e        HTTP server port number\n -s,--server            run HTTP server\n -t,--timelimit \u003carg\u003e   time limit\n```\nBy default all supported backends will be used unless\nyou explicitly give a comma separated list of the\nbackends. Note that all arguments should be passed in the way given above.\n\n## Running the benchmark ##\nUse the option -b to run the benchmark.\n \nThe default input file is [src/test/resources/benchmark.csv](src/test/resources/benchmark.csv),\nwhile the default output is the file *build/benchmark.html*.\nYou may want to see a [demo](demo/benchmark.html) of\nthe generated output ([rendered version](http://htmlpreview.github.io/?https://github.com/kovzol/realgeom/blob/master/demo/benchmark.html)).\nHere the time limit is 1 hour which is the default. It can be changed by\nsetting the maximal amount of seconds with the -t option.\n\n## Running realgeom as a web service ##\n\nUse the option -s to start the program as a web service.\n\nBy default a web server will be listening on port 8765, this\ncan be changed by using the -p option. (Remember that you may\nnot use port numbers less than 1024 on your machine unless\nyou have root access. The given port may also be blocked\nby various firewalls.)\n\nThen you can invoke a concrete computation\nby issuing the following HTTP request (from your browser):\n```\nhttp://your.domain.or.ip.address:8765/triangle?lhs=a*a+b*b+c*c\u0026rhs=a*b+b*c+c*a\u0026log=verbose\n```\nthat should return something like\n```\nLOG: log=VERBOSE,mode=EXPLORE,cas=MAPLE,tool=REGULAR_CHAINS,subst=AUTO,lhs=a*a+b*b+c*c,rhs=a*b+b*c+c*a,timelimit=300\nLOG: subst() =\u003e lhs=1+b*b+c*c,rhs=b+b*c+c\nLOG: ineqs=(m\u003e0) \u0026and (1+b\u003ec) \u0026and (b+c\u003e1) \u0026and (c+1\u003eb) \u0026and (1+b*b+c*c=m*(b+b*c+c))\nLOG: code=with(RegularChains):with(SemiAlgebraicSetTools):timelimit(300,lprint(QuantifierElimination(\u0026E([b,c]),(m\u003e0) \u0026and (1+b\u003ec) \u0026and (b+c\u003e1) \u0026and (c+1\u003eb) \u0026and (1+b*b+c*c=m*(b+b*c+c)))));\nLOG: result=`\u0026or`(m-1 = 0,5*m-6 = 0,`\u0026and`(0 \u003c m-1,5*m \u003c 6),`\u0026and`(0 \u003c 5*m-6,m^2+2*m \u003c 4),\n`\u0026and`(m^2+2*m-4 = 0,0 \u003c m),`\u0026and`(m \u003c 2,0 \u003c m^2+2*m-4,0 \u003c m))\nLOG: mathcode=Print[Quiet[Reduce[Or[m-1 == 0,5*m-6 == 0,And[0 \u003c m-1,5*m \u003c 6],And[0 \u003c 5*m-6,m^2+2*m \u003c 4],And[m^2+2*m-4 == 0,0 \u003c m],And[m \u003c 2,0 \u003c m^2+2*m-4,0 \u003c m]],m,Reals] // InputForm]]\nInequality[1, LessEqual, m, Less, 2]\nLOG: time=1.926\n```\nin your browser. The interpretation of this result is that the equation\n(a²+b²+c²)=m·(a·b+b·c+c·a)\nhas solutions for 1≦m\u003c2.\n\n(You can use both the -b and -s options. In this case first\nthe benchmark will be performed, and only after it will\nbe available the connection to the web service.)\n\n## Use case\n\n**realgeom** is an external service used by recent versions of [GeoGebra Discovery](https://github.com/kovzol/geogebra-discovery).\n\n## Frequently asked questions ##\n* My Java is too old, how to work this around? Download a newer Java JDK version and set the JAVA_HOME to the correct installation folder after unzipping it, before typing `./gradlew run`.\n* How to enter the caret (^) symbol in the web service? Use %5e instead, e.g. a%5e2 instead of a^2.\n* Which parameters are accepted by the web service? See the file [HTTPServer.java](src/main/java/realgeom/HTTPServer.java) for the current options.\n\n## Credits ##\n**realgeom** internally uses the Java port of the [Giac](https://www-fourier.ujf-grenoble.fr/~parisse/giac.html) CAS for some\ncomputations, based on the [SWIG](http://www.swig.org/) C++ to Java translator. Automated loading\nof the native JAR package of Giac was borrowed from [GeoGebra](http://www.geogebra.org/).\n\nWe are thankful to the [Research Institute for Symbolic Computations (RISC)](http://www.risc.jku.at/) at\nthe [Johannes Kepler University (JKU)](http://www.jku.at/content), Linz, Austria, for allowing access to their\ncomputer algebra resources.\n\n[Christopher W. Brown](https://github.com/chriswestbrown) kindly helped in speeding up operation of the backends QEPCAD and Tarski.\nWe acknowledge [Daniel Carvalho](https://community.wolfram.com/web/danielscarvalho)'s help in speeding up\nMathematica's computations.\n\n## Note on Mathematica runtime ##\nFor technical convenience this source tree contains Mathematica's `JLink.jar` and the shared library\n`libJLinkNativeLibrary.so`.\nThese are required to compile and start **realgeom** properly. To be able to use Mathematica, however,\nyou need a license and a full installation.\n\n## Authors ##\n* Róbert Vajda \u003cvajdar@math.u-szeged.hu\u003e\n* Zoltán Kovács \u003czoltan@geogebra.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkovzol%2Frealgeom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkovzol%2Frealgeom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkovzol%2Frealgeom/lists"}