Xiufen Xu
Xiufen Xu

Reputation: 531

Using quil.core/ellipse to draw an 8 pattern in clojure

I want to draw an sketch with eight pattern. Now I know how to draw circles in counterclockwise and clockwise directions. But I do not know how to combine them.

(defn draw-state [state]
   (let [x (* 150 (quil.core/cos angle))
         y (* 150 (quil.core/sin angle))]
      (quil.core/ellipse x y 100 100)
      (quil.core/ellipse y x 100 100)))

This function will draw two circles in opposite directions. But how to draw a sketch with 8 pattern?

Upvotes: 1

Views: 110

Answers (1)

nilo de roock
nilo de roock

Reputation: 4157

A polar equation for an 8-type of curve =

r^2 = Cos[2t] (Sec[t])^4

where r = radius, t = angle

You could start with this.

Upvotes: 1

Related Questions