Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divs1210/maya
A Clojure DSL for math and numerical work
https://github.com/divs1210/maya
Last synced: about 5 hours ago
JSON representation
A Clojure DSL for math and numerical work
- Host: GitHub
- URL: https://github.com/divs1210/maya
- Owner: divs1210
- License: epl-1.0
- Created: 2015-08-02T12:12:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-15T17:59:58.000Z (over 8 years ago)
- Last Synced: 2023-05-12T03:05:16.444Z (over 1 year ago)
- Language: Clojure
- Homepage:
- Size: 9.77 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maya
## A Clojure(Script) DSL for math and numeric work
Leiningen: `[maya "1.1.0-SNAPSHOT"]`
Read the [introductory blog-post](http://pizzaforthought.blogspot.in/2015/01/maya-dsl-for-math-and-numerical-work.html).## Usage
Expressions are always evaluated from left to right.
```clojure
(require '[maya.core :refer :all]
'[maya.util :refer :all])(defn quadratic
[^double a ^double b ^double c]
(|> 4 * a * c :as d,
b * b - d ** 0.5 :as D,
2 * a :as t, (- b) :as -b,
-b + D / t :as x1,
-b - D / t :as x2,
[x1 x2]))(quadratic 1 2 -3) ;=> [1.0 -3.0]
```## License
Copyright © 2015 Divyansh Prakash
Distributed under the Eclipse Public License version 1.0