Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure Trigonometry

In 2014, where do I get Clojure trigonometry functions like sin and atan2 ?

I see some of contrib.math is now in https://clojure.github.io/math.numeric-tower/ but that doesn't seem to have these functions.

like image 609
interstar Avatar asked Apr 28 '14 23:04

interstar


2 Answers

You can call functions in the Java Math class from Clojure.

Java: Math.sin(x)

Clojure: (Math/sin x)

like image 193
Ferruccio Avatar answered Oct 30 '22 20:10

Ferruccio


The Incanter statistical package for Clojure includes acos, asin, atan, atan2, cos, sin, and tan, along with many other potentially useful mathematical functions.

like image 2
Mars Avatar answered Oct 30 '22 20:10

Mars