Skip to content

Commit b51c1de

Browse files
committed
Removed var usage
1 parent a6f76af commit b51c1de

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Quaternion.js is a well tested JavaScript library for 3D rotations. Quaternions
99
## Examples
1010

1111
```js
12-
var Quaternion = require('quaternion');
12+
const Quaternion = require('quaternion');
1313

14-
var q = new Quaternion("99.3+8i");
14+
const q = new Quaternion("99.3+8i");
1515
c.mul(1,2,3,4).div([3,4,1]).sub(7, [1, 2, 3]);
1616
```
1717

@@ -21,11 +21,11 @@ c.mul(1,2,3,4).div([3,4,1]).sub(7, [1, 2, 3]);
2121
In order to create a HTML element, which always rotates in 3D with your mobile device, all you need is the following snippet. Look at the examples folder for a complete version.
2222

2323
```javascript
24-
var deg = Math.PI / 180;
24+
const deg = Math.PI / 180;
2525
window.addEventListener("deviceorientation", function(ev) {
2626

2727
// Update the rotation object
28-
var q = Quaternion.fromEulerLogical(ev.alpha * deg, ev.beta * deg, -ev.gamma * deg, 'ZXY');
28+
const q = Quaternion.fromEulerLogical(ev.alpha * deg, ev.beta * deg, -ev.gamma * deg, 'ZXY');
2929

3030
// Set the CSS style to the element you want to rotate
3131
elm.style.transform = q.toCSSTransform();

Diff for: dist/quaternion.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "quaternion",
33
"title": "Quaternion.js",
4-
"version": "2.0.1",
5-
"homepage": "https://github.com/rawify/Quaternion.js",
4+
"version": "2.0.2",
5+
"homepage": "https://raw.org/book/algebra/quaternions/",
66
"bugs": "https://github.com/rawify/Quaternion.js/issues",
77
"description": "A rotation library using quaternions",
88
"keywords": [

Diff for: quaternion.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type QuaternionAugmentedArray = [number, number, number];
4141

4242
type AnyQuaternionArray = QuaternionArray | QuaternionAugmentedArray;
4343

44-
declare class Quaternion {
44+
export class Quaternion {
4545
constructor(w?: number, x?: number, y?: number, z?: number);
4646
constructor(quaternion: string | AnyQuaternionArray | QuaternionRecord);
4747
// tslint:disable-next-line:unified-signatures Avoid union of QuaternionRecord and QuaternionComplexRecord fields
@@ -137,4 +137,4 @@ declare namespace Quaternion {
137137
function fromMatrix(matrix: Matrix3 | Matrix3_2D): Quaternion;
138138
}
139139

140-
export = Quaternion;
140+
export default Quaternion;

Diff for: src/quaternion.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @license Quaternion.js v2.0.1 10/28/2024
3-
* https://github.com/rawify/Quaternion.js
2+
* @license Quaternion.js v2.0.2 12/1/2024
3+
* https://raw.org/book/algebra/quaternions/
44
*
55
* Copyright (c) 2024, Robert Eisele (https://raw.org/)
66
* Licensed under the MIT license.

0 commit comments

Comments
 (0)