PENGUIN ROBOT Round Number - the Code
Title: Penguin Round Number Program
Code Name: penguin_round_number.bpx
Purpose: Round a number using a mathematical remainder technique
This program takes an input number from 0 to 360, scales it by 6
division, determines the remainder, then rounds up when determined.
The scale is used for more accurately plotting circle angles for
compass code.
The input number is generated automatically and runs through the
complete set of angle values from 0 to 360 degrees. The scaled
number results from the 6 divisor. The remainder technique is
used determine the remainder of the scaled number. The
remainder is then used to round the final value, increasing the
accuracy of the final result. The data scrolls automatically on the
Debug screen.
The code is very useful for many compass programs that
require scaling from 0 to 360 degrees, or most angular code
that require data crunching and rounding.
humanoido
Code Name: penguin_round_number.bpx
Purpose: Round a number using a mathematical remainder technique
This program takes an input number from 0 to 360, scales it by 6
division, determines the remainder, then rounds up when determined.
The scale is used for more accurately plotting circle angles for
compass code.
The input number is generated automatically and runs through the
complete set of angle values from 0 to 360 degrees. The scaled
number results from the 6 divisor. The remainder technique is
used determine the remainder of the scaled number. The
remainder is then used to round the final value, increasing the
accuracy of the final result. The data scrolls automatically on the
Debug screen.
The code is very useful for many compass programs that
require scaling from 0 to 360 degrees, or most angular code
that require data crunching and rounding.
humanoido
humanoido said...
This code is an integral part of the upcoming
Penguin Compass Plotter. With Compass Plotter, Penguin will report
cardinal compass positions to the Debug screen, scale, and graphically
plot to a virtual compass band, while constantly updating with real time
graphics.