Skip to content

Update Go version and dependencies; add Angle method to Point type#18

Merged
kelindar merged 1 commit intomasterfrom
angle
Aug 17, 2025
Merged

Update Go version and dependencies; add Angle method to Point type#18
kelindar merged 1 commit intomasterfrom
angle

Conversation

@kelindar
Copy link
Copy Markdown
Owner

This pull request introduces a new method for calculating the directional angle between two Point instances and adds comprehensive unit tests to verify its correctness. It also updates dependencies to use newer versions of Go and the testify library.

Feature: Directional Angle Calculation

  • Added a new Angle method to the Point type, which calculates the direction from one point to another and maps it to one of eight compass directions (Direction). This uses trigonometry to determine the angle and rounds it to the nearest cardinal or intercardinal direction.
  • Imported the math package in point.go to support the new angle calculation logic.

Testing Improvements

  • Added a thorough set of unit tests in point_test.go for the new Point.Angle method, covering all cardinal and intercardinal directions, edge cases, and negative coordinates.

Dependency Updates

  • Updated the Go version in go.mod from 1.24 to 1.25.
  • Updated the github.com/stretchr/testify dependency from v1.9.0 to v1.10.0 in go.mod.

@kelindar kelindar merged commit c3a5eaf into master Aug 17, 2025
2 checks passed
@kelindar kelindar deleted the angle branch August 17, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant