W3C home > Mailing lists > Public > www-svg@w3.org > July 2012

Re: Percentage lengths in SVG 1.1 sec 7.10

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 23 Jul 2012 10:22:58 -0700
Message-ID: <CAGN7qDC7Wa=C6rsoangoEgdbtkXsxQ_V8wT+uLCyP4PaPzxFow@mail.gmail.com>
To: Alan Stearns <stearns@adobe.com>
Cc: "www-svg@w3.org" <www-svg@w3.org>
I think the formula comes from the average of a ellipse:
Maybe you create a hypothetical ellipse with the SVG's width and height and
use the length at 45 degrees.


On Fri, Jul 20, 2012 at 11:51 AM, Alan Stearns <stearns@adobe.com> wrote:

> 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 Monday, 23 July 2012 17:23:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:36 UTC