0

I'm trying to grasp some haskell by drawing simple pictures with gloss library. Is there a way to get a picture size?

circ :: Picture
circ = circle 100

I'm looking for something like:

width circ -- returns 200
Lukh
  • 121
  • 1
  • 7
  • Given the internal representation, it looks hard-ish to do. Gloss essentially uses a representation similar to "draw there two rectangle and this arc, then translate and rotate, then ..." and it's not trivial to compute a bounding box with that. I'd guess there is no such function available in the libraries. Why do you actually need that? – chi Oct 07 '22 at 16:40
  • I'm looking a way to draw 2 pictures beside or above one another. In fact I'm trying to port functions that I once used in racket: beside and above. - beside (circle 100) (circle 100) - - above (circle 100) (circle 100 ) - would produce a Picture with 2 circles one beside/above the other. – Lukh Oct 07 '22 at 18:23

0 Answers0