Holomatix

Log In / Register


Purchase
Vector3d.cross()

Usage

myVec3d.cross(vec3d:Vector3d) : Vector3d

Parameters

  • vec3d A Vector3d to cross product with myVec3d.

Returns

A Vector3d.

Description

Method; returns the cross product of myVec3d with vec3d. This is equlivalent to

var cross = new Vector3d(myVec3d.y*vec3d.z - myVec3d.z*vec3d.y,
      myVec3d.z*vec3d.x - myVec3d.x*vec3d.z,
      myVec3d.x*vec3d.y - myVec3d.y*vec3d.x);

Note that myVec3d.cross(vec3d) is not the same as vec3d.cross(myVec3d). 

Example

var vec1 = new Vector3d(4, 5, 6);
var vec2 = new Vector3d(7, 8, 9);
trace(vec1.cross(vec2)); //displays (-3, 6, -3) 
 
< Prev   Next >


© Copyright 2000-2011 Holomatix Ltd. All rights reserved.