diff --git a/package.json b/package.json index e98b010..a8d0ef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@viamrobotics/three", - "version": "0.0.5", + "version": "0.0.6", "license": "Apache-2.0", "type": "module", "files": [ diff --git a/src/orientation-vector.ts b/src/orientation-vector.ts index 3a8b96d..4e067c8 100644 --- a/src/orientation-vector.ts +++ b/src/orientation-vector.ts @@ -131,6 +131,12 @@ export class OrientationVector { } setUnits(units: 'degrees' | 'radians'): this { + if (units === 'degrees' && this.#units === 'radians') { + this.#th = MathUtils.degToRad(this.#th); + } else if (units === 'radians' && this.#units === 'degrees') { + this.#th = MathUtils.radToDeg(this.#th); + } + this.#units = units; return this;