Skip to content

Commit

Permalink
BREAKING: Rename Vector2.prototype.div to `Vector2.prototype.divide…
Browse files Browse the repository at this point in the history
…` to match other basic operator naming
  • Loading branch information
ericyd committed Jan 31, 2024
1 parent b6a844f commit 66bb1eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/data-structures/fractalized-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class FractalizedLine {
const perpendicular =
Math.atan2(end.y - start.y, end.x - start.x) - Math.PI / 2.0
const maxDeviation = (start.subtract(end).length() / 2.0) * offsetPct
const mid = start.add(end).div(2)
const mid = start.add(end).divide(2)
const offset = random(-maxDeviation, maxDeviation, this.rng)
return new Vector2(
mid.x + Math.cos(perpendicular) * offset,
Expand Down
2 changes: 1 addition & 1 deletion lib/vector2.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Vector2 {
* @param {number} n
* @returns {Vector2}
*/
div(n) {
divide(n) {
return vec2(this.x / n, this.y / n)
}

Expand Down

0 comments on commit 66bb1eb

Please sign in to comment.