diff --git a/zh-cn/application-dev/reference/apis/js-apis-sensor.md b/zh-cn/application-dev/reference/apis/js-apis-sensor.md index 9a6f1207744a901dac3d9bdc718d83eead38c923..d22706b127d02eca6495ee5b5a8b792be6c3700b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-sensor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-sensor.md @@ -1972,7 +1972,7 @@ createRotationMatrix(rotationVector: Array<number>, callback: AsyncCallbac err.message); return; } - for (var i=0; i < data.rotation.length; i++) { + for (var i=0; i < data.length; i++) { console.info("data[" + i + "]: " + data[i]); } }) @@ -2005,7 +2005,7 @@ createRotationMatrix(rotationVector: Array<number>): Promise<Array<n const promise = sensor.createRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877]); promise.then((data) => { console.info('createRotationMatrix_promise success'); - for (var i=0; i < data.rotation.length; i++) { + for (var i=0; i < data.length; i++) { console.info("data[" + i + "]: " + data[i]); } }).catch((reason) => { @@ -2172,7 +2172,7 @@ createRotationMatrix(gravity: Array<number>, geomagnetic: Array<number& err.message); return; } - for (var i=0; i < data.length; i++) { + for (var i=0; i < data.rotation.length; i++) { console.info("data[" + i + "]: " + data[i]) } }) @@ -2206,7 +2206,7 @@ createRotationMatrix(gravity: Array<number>, geomagnetic: Array<number& const promise = sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]); promise.then((data) => { console.info('createRotationMatrix_promise successed'); - for (var i=0; i < data.length; i++) { + for (var i=0; i < data.rotation.length; i++) { console.info("data[" + i + "]: " + data[i]); } }).catch((err) => {