ph91.de
  • Home
  • About me
  • Categories
    • Software Development
    • New Zealand
    • Music
    • Tech & IT
    • Sports
    • Dublin
    • Junk
  • Contact
  • Disclaimer
ph91.de
ph91.de
  • Home
  • About me
  • Categories
    • Software Development
    • New Zealand
    • Music
    • Tech & IT
    • Sports
    • Dublin
    • Junk
  • Contact
  • Disclaimer
  • Allgemein
  • Software Development

Convert to degree to direction (the beautiful way)

  • 15. August 2020

Recently I encountered the issue of converting a degree in ° (0-360) to a direction (compass directions). On my internet research I only found “ugly” solutions where the minAngle and maxAngle were explicitly listed for each direciont (N, NNE, NE, NEE…).

There was no chance that I would copy such ugly code into my codebase, therefore it made the effort to think about a more beautful way to solve this task. In the end, I came up with this:

Related Topics
  • direction
  • enum
  • java
Philipp

Previous Article
  • Allgemein

I’m running in Docker

  • 17. February 2020
  • Philipp
View Post
Next Article
action adventure beach clouds
  • Software Development

Creating “Windwarner”

  • 2. January 2021
  • Philipp
View Post

Leave a Reply

Your email address will not be published. Required fields are marked *

Dev profiles
  • BitBucket
  • Github
  • Stackoverflow
Side Projects
  • NMF
  • Speed-kini.de
  • Sudoku Solver
  • Windwarner
Archive
ph91.de
Blog by Philipp Schreitmüller

Input your search keywords and press Enter.