2019-01-19 19:27:57 +01:00
|
|
|
# Ultra32
|
|
|
|
|
2024-05-28 03:35:22 +02:00
|
|
|
A vector package using the fast float32array
|
2019-01-19 19:27:57 +01:00
|
|
|
|
|
|
|
# Get started:
|
|
|
|
|
|
|
|
To get started, install ultra32:
|
2024-05-28 03:35:22 +02:00
|
|
|
|
2019-01-19 19:27:57 +01:00
|
|
|
```
|
|
|
|
npm install ultra32 --save
|
|
|
|
```
|
|
|
|
|
|
|
|
A ultra32 vector is just a Float32Array.
|
|
|
|
|
|
|
|
```
|
|
|
|
const vec = new Float32Array([0,0]);
|
|
|
|
```
|
|
|
|
|
|
|
|
You can perform multiple operations:
|
2024-05-28 03:35:22 +02:00
|
|
|
|
2019-01-19 19:27:57 +01:00
|
|
|
```
|
|
|
|
add(vec,new Float32Array([1,2]));
|
|
|
|
mul(vec,3);
|
|
|
|
mirror(vec);
|
|
|
|
|
|
|
|
console.log(vec); //Float32Array [ -3, -6 ]
|
|
|
|
```
|