W3C home > Mailing lists > Public > www-style@w3.org > September 2010

Re: Linear gradients, Transforms and angles...

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 21 Sep 2010 11:21:59 -0700
Message-Id: <E180354D-1973-45C8-9764-3A40C5EF4EE3@gmail.com>
Cc: Simon Fraser <smfr@me.com>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, "L. DavidBaron" <dbaron@dbaron.org>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
To: Chris Marrin <cmarrin@apple.com>

On Sep 21, 2010, at 10:31 AM, Chris Marrin <cmarrin@apple.com> wrote:

> 
> On Sep 20, 2010, at 7:29 PM, Brad Kemper wrote:
> 
>> 
>> 
>> On Sep 20, 2010, at 2:01 PM, Chris Marrin <cmarrin@apple.com> wrote:
>> 
>>>> This author's expectations are that 90deg should be upward for a linear direction specified in degrees. All my prior experience in life before learning how programmers think reinforce that expectation. 
>>> 
>>> Angle is a concept that I believe is fairly new to CSS, so I don't think there is much of a precedent here.
>> 
>> Yes, but there is an long-time, pre-CSS precedent for specifying linear directions in the manner printed on traditional protractors.
> 
> And there is a long tradition in mathematics of the positive Y axis going up. But in HTML the Y axis goes down, because of the (western) tradition of reading from top to bottom.

I don't see how that is relevant to traditions of angle-based linear directions. You can still have 0deg=left-to-right and 90deg=bottom-to-top when y++ progresses downward. .

> Now, assuming your protractor is the clear plastic kind, flip it upside down. Which direction do positive angles go now?

You mean so that all the numbers are upside down and backwards? If you are trying to make the point that the way SVG specifies linear gradients is ass-backwards, then I agree with you. Maybe they should flip their linear gradient coordinates over to be more in line with common expectations. 

> The "right-hand rule" is the tradition in mathematics. But HTML flips Y (for good reason), so we use the left hand rule, which has clockwise rotations. It's all consistent. 

You mean where the closed fingers are pointing in the direction of rotation? That's fine if you want to rotate something in a circular direction. I don't. I want to indicate a LINEAR direction. I could say so a few more times, if it helps. Maybe at the C code level something is being rotated, but that gas little to do with the commonest HTML/CSS author's perspective. 

> 
>>> Using the math we are using in CSS transforms,
>> 
>> [...]
>> 
>>> means positive rotation angles go clockwise.
>>> 
>>>  -webkit-transform: rotate(10deg)
>>> 
>>> results in a clockwise rotation of the element to which it is applied. This is true in both WebKit and Firefox
>> 
>> That's fine. My point is that designers do not think of a linear direction as being the same as a rotation. At least I don't. So something that is entirely sensible for specifying an amount of rotation (an amount of turning in a circular direction) is not necessarily appropriate or relevant to specifying a straight, linear direction. To me it is counter-intuitive to do so, as it confuses two entirely different types of direction. 
>> 
>> When I walk north, I do not think of myself as pointing a default of east and then turning -90 degrees before starting forward. I just walk straight in the direction I want to go.
> 
> Are you saying that you don't think we should use the left hand rule for rotation just because we use it for orientation?

I don't know you you read that into what I've said, since I keep repeating the exact opposite. Use whatever makes sense when you want to rotate something, just don't use it as justification for an unintuitive system of specifying linear direction. 

> If so, I suppose that's a valid point of view, but it is neither logically nor mathematically consistent.

Yeah, it's a straw-man rebuttal. 
Received on Tuesday, 21 September 2010 18:24:05 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:31 GMT