* Calculates the cross product of two vectors. * * The cross product is a vector that points straight out of the plane created * by two vectors. The cross product's magnitude is the area of the parallelogram * formed by the original two vectors. * * The cross product is defined on
(v)
| 1444 | * } |
| 1445 | */ |
| 1446 | cross(v) { |
| 1447 | const x = this.y * v.z - this.z * v.y; |
| 1448 | const y = this.z * v.x - this.x * v.z; |
| 1449 | const z = this.x * v.y - this.y * v.x; |
| 1450 | if (this.isPInst) { |
| 1451 | return new Vector(this._fromRadians, this._toRadians, x, y, z); |
| 1452 | } else { |
| 1453 | return new Vector(x, y, z); |
| 1454 | } |
| 1455 | } |
| 1456 | |
| 1457 | /** |
| 1458 | * Calculates the distance between two points represented by vectors. |
no outgoing calls
no test coverage detected