This code that I wrote gives me the error:
java.lang.Long cannot be cast to clojure.lang.IFn
which means that I am using a number where a function is expected.
I think it has to do with the expt functions from clojure.math.numeric-tower but I am not sure. cryptic error messages FTL.
(ns point-normalize.core
(:require [clojure.math.numeric-tower :as math :only (sqrt expt)]))
(defn normalize [x y]
(let [x1 (/ x (math/sqrt ((math/expt x 2)+ (math/expt y 2))))
y1 (/ y (math/sqrt ((math/expt x 2)+ (math/expt y 2))))]
(x1 y1)))
Any hints would be appreciated. Thank You.