Add angle distance functions by samme · Pull Request #7092 · phaserjs/phaser · GitHub
Skip to content

Add angle distance functions#7092

Merged
zekeatchan merged 1 commit into
phaserjs:v4.0.0from
samme:feature/v4.0.0/math-angle-distances
Apr 3, 2025
Merged

Add angle distance functions#7092
zekeatchan merged 1 commit into
phaserjs:v4.0.0from
samme:feature/v4.0.0/math-angle-distances

Conversation

@samme

@samme samme commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

This PR

  • Adds a new feature

After #7091 I thought there should be a way to make a rotation in one direction or another.

New Features

  • Phaser.Math.Angle.GetClockwiseDistance() gets the shortest nonnegative angular distance between two angles.
  • Phaser.Math.Angle.GetCounterClockwiseDistance() gets the shortest nonpositive angular distance between two angles.
  • Phaser.Math.Angle.GetShortestDistance() gets the shortest signed angular distance between two angles. (This is like Phaser.Math.Angle.ShortestBetween() but in radians.)

Tests

@samme samme force-pushed the feature/v4.0.0/math-angle-distances branch from f5bf394 to bf92829 Compare April 1, 2025 16:41
@zekeatchan zekeatchan merged commit cbe6d08 into phaserjs:v4.0.0 Apr 3, 2025
@zekeatchan

zekeatchan commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

zekeatchan added a commit that referenced this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants