Last active
June 23, 2016 19:52
-
-
Save skrat/0b79deeeca4dfdbdccc26ca8b48afc33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojure-nen2580.core | |
(:require [thi.ng.geom.core :as g] | |
[thi.ng.geom.line :as l)) | |
(defn normal [l] | |
(let [[p q] (:points l)] | |
(g/normalize (g/- q p)))) | |
(defn continuous? [a b] | |
(let [na (normal a) | |
nb (normal b)] | |
(and | |
(some (partial g/contains-point? a) (:points b)) | |
(= 1 (Math/abs (g/dot na nb)))))) | |
(continuous? | |
(l/line2 [ 0 0] [100 0]) | |
(l/line2 [100 0] [200 0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment