Skip to content

Commit f2c9797

Browse files
committed
Quaternion: Simplify .angleTo()
1 parent e1ed817 commit f2c9797

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/math/Quaternion.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -393,21 +393,11 @@ Object.assign( Quaternion.prototype, {
393393

394394
}(),
395395

396-
angleTo: function () {
396+
angleTo: function ( q ) {
397397

398-
var p = new Quaternion();
398+
return 2 * Math.acos( Math.abs( this.dot( q ) ) );
399399

400-
return function angleTo( q ) {
401-
402-
p.copy( this ).inverse();
403-
404-
p.premultiply( q );
405-
406-
return 2 * Math.acos( p.w );
407-
408-
};
409-
410-
}(),
400+
},
411401

412402
inverse: function () {
413403

0 commit comments

Comments
 (0)