Re: quick comments on Matrix

On Fri, Mar 15, 2013 at 5:51 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> > In rotateFromVector(By), what happens if the x or y coordinate is zero?
> Actually it's not clear to me why these can't be zero.
>
> This was taken over from SVG. The calculation is "(+/-) atan(y/x)". While
> y could be zero, x can't. I assume the editors of SVG wanted to have
> consistency between the values.
>

The case where x is 0 makes geometric sense though. The only case that
doesn't make sense is when both x *and* y are zero. I think SVG got this
wrong.

> What's the rationale for using double for matrix elements? Are
> implementations allowed to use 32-bit precision internally?
>
> WebIDL requires a datatype for attributes. In this case there was the
> choice between float (32-bit precision) and double (64-bit precision). The
> later seems to make more sense - especially because of Float64Array.
>

I think it's worth considering whether we need to specify that the
implementation uses double precision. On one hand, specifying the precision
would help interop. On the other hand, requiring every Matrix to be backed
by a 4x4 matrix of float64s might have a real performance penalty vs
float32s.

Rob
-- 
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]

Received on Friday, 15 March 2013 05:32:00 UTC