Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Suppose I create a Rectangle of dimensions 1 and 3. Is there any function in Mathematica that I can use to recover the dimensions of the original rectangle? If there is no such a function, is there a way of recovering the dimensions?

share|improve this question
add comment

1 Answer 1

I assume you mean from a Graphics object. If so, something like:

Cases[g, Rectangle[x___] :> {x}, 2]

where g is the graphics object will return a list of coordinates from which dimensions can be derived.

share|improve this answer
    
It works perfectly, thank you very much –  libercaptor Mar 19 at 1:21
2  
Worth to add Normal on g in case of GraphicsComplex. –  Kuba Mar 19 at 6:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.