两垂直向量的外积计算
cesium.corss()函数:
Cartesian3.cross = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
Check.typeOf.object('left', left);
Check.typeOf.object('right', right);
Check.typeOf.object('result', result);
//>>includeEnd('debug');
var leftX = left.x;
var leftY = left.y;
var leftZ = left.z;
var rightX = right.x;
var rightY = right.y;
var rightZ = right.z;
var x = leftY * rightZ - leftZ * rightY;
var y = leftZ * rightX - leftX * rightZ;
var z = leftX * rightY - leftY * rightX;
result.x = x;
result.y = y;
result.z = z;
return result;
};
外积公式: