soegaard / metapict

A graphics library for producing Racket picts in a MetaPost/TikZ style.
http://soegaard.github.io/metapict/
65 stars 13 forks source link

Improve running time for intersection-point #15

Open soegaard opened 10 years ago

soegaard commented 10 years ago

(intersection-point unitcircle (curve origo -- (pt* 100 (pt 1 1)))) (pt 0.7071067811865506 0.7071067811865446) (intersection-point unitcircle (curve origo -- (pt* 100 (pt 1 1)))) (pt 0.7071067811865506 0.7071067811865446) (time (intersection-point unitcircle (curve origo -- (pt* 10 (pt 1 1))))) cpu time: 5 real time: 5 gc time: 0 (pt 0.7071067811865479 0.707106781186547) (time (intersection-point unitcircle (curve origo -- (pt* 100 (pt 1 1))))) cpu time: 39 real time: 61 gc time: 0 (pt 0.7071067811865506 0.7071067811865446) (time (intersection-point unitcircle (curve origo -- (pt* 1000 (pt 1 1))))) cpu time: 316 real time: 331 gc time: 56 (pt 0.707106781186573 0.7071067811865221) (time (intersection-point unitcircle (curve origo -- (pt* 10000 (pt 1 1))))) cpu time: 3581 real time: 3769 gc time: 551 (pt 0.7071067811870169 0.7071067811860783) (time (intersection-point unitcircle (curve origo -- (pt* 100000 (pt 1 1))))) cpu time: 28672 real time: 30157 gc time: 4298 (pt 0.707106781189409 0.707106781183686)