This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear visitors,
This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.
We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.
At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.
Thank you for understanding.
Script Title: degToEightDir
Programming Language: Java Script
Date Completed: 2012/09/02
Purpose: To determine the direction something is from degrees. Returns a number between 0-7.
Description: Determine the direction something is based on an eight way system of direction from degrees. Determines the direction using eight directions, returns a number ( 0,1,2,3,4,5,6,7 ), returns NaN (Not a Number) if the degrees argument is not a number, is a value greater than 360 or is a value lesser than -360.
Returned Values:
0 – Top
1 – Top Right
2 – Right
3 – Bottom Right
4 – Bottom
5 – Bottom Left
6 – Left
7 – Top Left
NaN – If the degrees_n argument is not valid
Method:
degToEightDir ( degrees_n ); // Returns a number
Arguments: degrees_n, accepts a number between -360 to 360.
Example Usage:
degToEightDir ( 180 ); // Returns 4
degToEightDir ( -180 ); // Returns 4
degToEightDir ( 760 ); // Returns NaN
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.