On Wed, Jun 16, 2010 at 2:48 PM, William <[email protected]> wrote:

> On Jun 16, 1:44 pm, Chad Killingsworth
> <[email protected]> wrote:
> > That's a pretty specific bug.
>
> yeah it's something due to numerical instability.
>
> looking at the code before the bug, there is
>
> b=cos(f)
> f=sin(f)
>
> which produces the values are b=-1 and f=2.2e-16 (not zero)
>
> the bearing is close to zero (true north), but the cos function
> returns a value of -1 as if the angle was zero, but the sin function
> returns a small value.
>
> the matrix is a skew matrix for VML, so maybe the matrix eigenvalue
> has to be *exactly* 1?  Not sure what the tolerance would be.
>

I don't think so.  I believe you can use skew matrices for scaling, in which
case the eigenvalue is not 1 but s^2 (if scaling by "s" in x and y).

What was the value of e?  I wonder if the matrix must be invertible.

Or maybe it's a floating point underflow problem?


Floating point rounding explains why the cosine evaluates to -1, since the
cosine is -sqrt(1 - (2.2e-16)^2) = -1 + (2.2e-16)^2 / 2 = -1 + 2.4e-32 which
cannot be distinguished from -1 in double-precision floating point.  But
underflow refers to a value being rounded to 0; I don't see that.


> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to