dot product sign error?

Can any reproduce this result? For some reason I’m getting a negative dot product from what are basically the same vectors:

vector1: {x:-6.123233902474582e-17,y:-0.9999999847691294,z:0.0001745329224753608}

vector2: {x:-2.8327694394977715e-16,y:-0.9999999847691294,z:0.0001745329224753608}

Here are 2 code snippets to inject into camera.js and Camera Tutorial.js. These 2 vectors should be the result.

//start test code

//place this in camera.js right after: Cartesian3.cross(this.direction, this.up, this.right);

var temp1 = Matrix3.getColumn(Matrix4.getRotation(localTransform,new Matrix3),1,new Cartesian3);

var temp2 = this.direction;

console.log(" dot temp1 temp2 ",,temp2));

console.log(" temp1 ",temp1);

console.log(" temp2 ",temp2);

console.log(" test1 ",{x:-6.123233902474582e-17,y:-0.9999999847691294,z:0.0001745329224753608},


console.log(" test2 ",-6.123233902474582e-17*-2.8327694394977715e-16±0.9999999847691294*-0.9999999847691294+0.0001745329224753608*0.0001745329224753608);

//end test code


//start test code

//place this in Camera Tutorial right before: viewer.clock.onTick.addEventListener(function(clock) {


var position = new Cesium.Cartographic(Cesium.Math.toRadians(90.0), Cesium.Math.toRadians(89.99), 10);

var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);;{

heading : Cesium.Math.toRadians(0.0),

pitch : Cesium.Math.toRadians(0.0),

roll : Cesium.Math.toRadians(0.0)


//end test code


I don’t even know what this.direction is. If I add these lines
console.log(" this.direction ",this.direction);

console.log(" this.direction.x is ",this.direction.x);

console.log(" this.direction.y is ",this.direction.y);

console.log(" this.direction.z is ",this.direction.z);

console.log(" this.direction ",this.direction);


I get this output:

this.direction Cartesian3x: -2.8327694394977715e-16y: -0.9999999847691294z: 0.0001745329224753608__proto__: Cartesian3

this.direction.x is 2.220446049250313e-16

this.direction.y is 1

this.direction.z is 0

this.direction Cartesian3x: -2.8327694394977715e-16y: -0.9999999847691294z: 0.0001745329224753608__proto__: Cartesian3

Well, which is it? If I run that code on the temp1 var I get expected results where the component version matches the composite version.

I think I figured out what is going on. The component and composite forms of ‘this.direction’ do match after the last line

It settles on y:-0.999… which is correct for Earth fixed coordinates at heading 0 near the north pole on the +90 longitude line (+90 longitude line is in the +y direction.)

y:+1.00 is correct for local ENU coordinates with heading at 0 and pitch at 0.

For whatever reason:

-the composite form does NOT display what the value is when the console.log command was performed (rather at a later time)

-the component form DOES display what the value is when the console.log command was performed

The moral of the story seems to be use component form if you want to know the value at the time the console.log command was called. This seems to be the case for Chromium based browsers (Chrome and Opera) and Firefox.