2018-10-08 13:34:43 -04:00
---
title: Vector cross product
id: 594810f028c0303b75339ad2
challengeType: 5
2018-10-10 16:20:40 -04:00
videoUrl: ''
localeTitle: Producto cruzado vector
2018-10-08 13:34:43 -04:00
---
## Description
2018-10-10 16:20:40 -04:00
< section id = "description" > Un vector se define como que tiene tres dimensiones como se representa por una colección ordenada de tres números: (X, Y, Z). < p > Tarea: < / p > < pre > < code > Write a function that takes two vectors (arrays) as input and computes their cross product.< / code > < / pre > < p > Su función debe devolver < code > null< / code > en entradas no válidas (es decir, vectores de diferentes longitudes). < / p > < p > < / p > < / section >
2018-10-08 13:34:43 -04:00
## Instructions
2018-10-10 16:20:40 -04:00
< section id = "instructions" >
2018-10-08 13:34:43 -04:00
< / section >
## Tests
< section id = 'tests' >
```yml
tests:
- text: puntoEl producto debe ser una función
testString: 'assert.equal(typeof crossProduct, "function", "dotProduct must be a function");'
- text: dotProduct () debe devolver null
testString: 'assert.equal(crossProduct(), null, "dotProduct() must return null");'
- text: 'crossProduct ([1, 2, 3], [4, 5, 6]) debe devolver [-3, 6, -3].'
testString: 'assert.deepEqual(res12, exp12, "crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3].");'
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```js
function crossProduct() {
// Good luck!
}
2018-10-10 16:20:40 -04:00
2018-10-08 13:34:43 -04:00
```
< / div >
### After Test
< div id = 'js-teardown' >
```js
console.info('after the test');
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
2018-10-10 16:20:40 -04:00
// solution required
2018-10-08 13:34:43 -04:00
```
< / section >