Skip to content

Commit

Permalink
Small improvement to vector length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Nov 5, 2024
1 parent 1d569d3 commit 2b185e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/library/utils/vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class Vector {
}

get length() {
return Math.hypot(this.x, this.y, this.z);
return Math.hypot(...this.vals);
}

set length(val: number) {
Expand Down

0 comments on commit 2b185e9

Please sign in to comment.