Percentage lengths in SVG 1.1 sec 7.10

Hey all,

There's a typo in section 7.10 in the formula for percentage lengths that
are not heights or widths. It's just an extra parenthesis before the
slash. So it should read:

sqrt((actual-width)**2 + (actual-height)**2)/sqrt(2)


But I'm also wondering what motivates this particular formula. I'm looking
at how a percentage value for the radius of a circle works. In a square
10x10 viewport it's a percentage of 10, which makes sense. You're getting
the length of the diagonal divided by the square root of 2, which gets you
back to height or width.

In a 20x10 rectangle, you get a percentage of 15.81. I don't understand
how that's useful in this case. You have the length of the diagonal on top
again, but how is the square root of 2 relevant for non-square viewports?
Is there a non-radius use case for percentage lengths in rectangles where
this result is useful, or was this formula chosen mainly to make a square
viewport work as expected?

Thanks,

Alan

Received on Friday, 20 July 2012 18:51:48 UTC