Binary scaling: Difference between revisions

Content deleted Content added
Line 71:
Binary angles are mapped using B0, with 0 as 0 degrees, 0.5 as 90° (or <math>\frac{\pi}{2}</math>), &minus;1.0 or 0.9999999 as 180° (or π) and &minus;0.5 as 270° (or <math>\frac{3\pi}{2}</math>). When these binary angles are added using normal [[two's complement]] mathematics, the rotation of the angles is correct, even when crossing the sign boundary (this of course does away with checks for angle ≥ 360° when handling normal degrees<ref>[http://blogs.msdn.com/shawnhar/archive/2010/01/04/angles-integers-and-modulo-arithmetic.aspx Angles, integers, and modulo arithmetic] Shawn Hargreaves, ''blogs.msdn.com''</ref>).
 
The terms '''Binary Angular Measurement System''' (BAMS)<ref>[http://acronyms.thefreedictionary.com/Binary+Angular+Measurement+System Binary Angular Measurement System] ''acronyms.thefreedictionary''</ref><ref name="ship">[http://www.tpub.com/content/fc/14100/css/14100_314.htm BINARY ANGULAR MEASUREMENT] {{webarchive |url=https://web.archive.org/web/20091221160257/http://www.tpub.com/content/fc/14100/css/14100_314.htm |date=December 21, 2009 }} ''www.tpub.com''</ref> and '''brads''' ('''binary radians''' or '''binary degree''') refer to implementations of binary angles. They find use in robotics, navigation,<ref>[http://www.globalspec.com/reference/14722/160210/Chapter-7-5-3-Binary-Angular-Measure Real-Time Systems Design and Analysis] Chapter 7.5.3, Binary Angular Measure , Phillip A. LaPlante, page via ''www.globalspec.com''</ref> computer games,<ref>[http://fabiensanglard.net/doomIphone/doomClassicRenderer.php Doom 1993 code review] Fabien Sanglard, section "Walls", 13/1/2010, ''fabiensanglard.net''</ref> and digital sensors.<ref>[http://www.hobbyengineering.com/specs/PX-29123.pdf Hitachi HM55B Compass Module (#29123)] {{webarchive |url=https://web.archive.org/web/20110711172521/http://www.hobbyengineering.com/specs/PX-29123.pdf |date=July 11, 2011 }} pdf via ''www.parallax.com'' via ''www.hobbyengineering.com''</ref> and weapon systems' digital communications<ref name="ship"/>
 
No matter what bit-pattern is stored in a binary angle, when it is multiplied by 180° (or π) using standard signed [[fixed-point arithmetic]], the result is always a valid angle in the range of −180° [[degree (angle)|degree]]s (−π [[radian]]s) to +180° degrees (+π radians).