HOME

TheInfoList



OR:

Binary angular measurement (BAM) (and the binary angular measurement system, BAMS) is a measure of
angle In Euclidean geometry, an angle can refer to a number of concepts relating to the intersection of two straight Line (geometry), lines at a Point (geometry), point. Formally, an angle is a figure lying in a Euclidean plane, plane formed by two R ...
s using
binary number A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
s and
fixed-point arithmetic In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. Dollar amounts, for example, are often stored with exactly two fractional digits, represen ...
, in which a full turn is represented by the value 1. The unit of angular measure used in those methods may be called binary radian (brad) or binary degree. These representation of angles are often used in
numerical control Computer numerical control (CNC) or CNC machining is the automated control of machine tools by a computer. It is an evolution of numerical control (NC), where machine tools are directly managed by data storage media such as punched cards or ...
and
digital signal processing Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are a ...
applications, such as robotics, navigation, computer games, and digital sensors, taking advantage of the implicit modular reduction achieved by truncating binary numbers. It may also be used as the
fractional part The fractional part or decimal part of a non‐negative real number x is the excess beyond that number's integer part. The latter is defined as the largest integer not greater than , called ''floor'' of or \lfloor x\rfloor. Then, the fractional ...
of a fixed-point number counting the number of full rotations of e.g. a vehicle's wheels or a
leadscrew A leadscrew (or lead screw), also known as a power screw or translation screw,Bhandari, p. 202. is a screw used as a linkage in a machine, to translate turning motion into linear motion. Because of the large area of sliding contact between ...
.


Representation


Unsigned fraction of turn

In this system, an angle is represented by an ''n''- bit unsigned binary number in the sequence 0, ..., 2''n''−1 that is interpreted as a multiple of 1/2''n'' of a full turn; that is, 360/2''n'' degrees or 2π/2''n'' radians. The number can also be interpreted as a fraction of a full turn between 0 (inclusive) and 1 (exclusive) represented in binary fixed-point format with a scaling factor of 1/2''n''. Multiplying that fraction by 360° or 2π gives the angle in degrees in the range 0 to 360, or in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. It is defined such that one radian is the angle subtended at ...
s, in the range 0 to 2π, respectively. For example, with ''n'' = 8, the binary integers (00000000)2 (fraction 0.00), (01000000)2 (0.25), (10000000)2 (0.50), and (11000000)2 (0.75) represent the angular measures 0°, 90°, 180°, and 270°, respectively. The main advantage of this system is that the addition or subtraction of the integer numeric values with the ''n''-bit arithmetic used in most computers produces results that are consistent with the geometry of angles. Namely, the integer result of the operation is automatically reduced
modulo In computing and mathematics, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another, the latter being called the '' modulus'' of the operation. Given two positive numbers and , mo ...
2''n'', matching the fact that angles that differ by an integer number of full turns are equivalent. Thus one does not need to explicitly test or handle the wrap-around, as one must do when using other representations (such as number of degrees or radians in floating-point).


Signed fraction of turn

Alternatively, the same ''n'' bits can also be interpreted as a signed integer in the range −2''n''−1, ..., 2''n''−1−1 in the
two's complement Two's complement is the most common method of representing signed (positive, negative, and zero) integers on computers, and more generally, fixed point binary values. Two's complement uses the binary digit with the ''greatest'' value as the ''s ...
convention. They can also be interpreted as a fraction of a full turn between −0.5 (inclusive) and +0.5 (exclusive) in signed fixed-point format, with the same scaling factor; or a fraction of half-turn between −1.0 (inclusive) and +1.0 (exclusive) with scaling factor 1/2''n''−1. Either way, these numbers can then be interpreted as angles between −180° (inclusive) and +180° (exclusive), with −0.25 meaning −90° and +0.25 meaning +90°. The result of adding or subtracting the numerical values will have the same sign as the result of adding or subtracting angles, once reduced to this range. This interpretation eliminates the need to reduce angles to the range when computing
trigonometric functions In mathematics, the trigonometric functions (also called circular functions, angle functions or goniometric functions) are real functions which relate an angle of a right-angled triangle to ratios of two side lengths. They are widely used in all ...
.


Example

In the orbital data broadcast by the
Global Positioning System The Global Positioning System (GPS) is a satellite-based hyperbolic navigation system owned by the United States Space Force and operated by Mission Delta 31. It is one of the global navigation satellite systems (GNSS) that provide ge ...
, angles are encoded using binary angular measurement. In particular, each satellite broadcasts an
ephemeris In astronomy and celestial navigation, an ephemeris (; ; , ) is a book with tables that gives the trajectory of naturally occurring astronomical objects and artificial satellites in the sky, i.e., the position (and possibly velocity) over tim ...
containing its six Keplerian
orbital elements Orbital elements are the parameters required to uniquely identify a specific orbit. In celestial mechanics these elements are considered in two-body systems using a Kepler orbit. There are many different ways to mathematically describe the same o ...
. Four of these are angles, which are encoded as 32-bit binary angles. In the lower-precision
almanac An almanac (also spelled almanack and almanach) is a regularly published listing of a set of current information about one or multiple subjects. It includes information like weather forecasting, weather forecasts, farmers' sowing, planting dates ...
data, 24-bit binary angles are used.


See also

* Grade, 1/400 of a full turn * Binary scaling * CORDIC, algorithms for trigonometric functions *
Constructible polygon In mathematics, a constructible polygon is a regular polygon that can be Compass and straightedge constructions, constructed with compass and straightedge. For example, a regular pentagon is constructible with compass and straightedge while a regu ...
, including all polygons with 2''n'' sides


References

{{reflist, refs= {{cite web , title=Binary angular measurement , url=http://www.tpub.com/content/fc/14100/css/14100_314.htm , archive-url=https://web.archive.org/web/20091221160257/http://www.tpub.com/content/fc/14100/css/14100_314.htm , archive-date=2009-12-21 {{cite web , title=Binary Angular Measurement System , work=acronyms.thefreedictionary , url=http://acronyms.thefreedictionary.com/Binary+Angular+Measurement+System {{cite web , title=Angles, integers, and modulo arithmetic , author-first=Shawn , author-last=Hargreaves , author-link=:pl:Shawn Hargreaves , publisher=blogs.msdn.com , url=http://blogs.msdn.com/shawnhar/archive/2010/01/04/angles-integers-and-modulo-arithmetic.aspx , access-date=2019-08-05 , url-status=live , archive-url=https://web.archive.org/web/20190630223817/http://www.shawnhargreaves.com/blogindex.html , archive-date=2019-06-30 {{cite book , title=Real-Time Systems Design and Analysis , chapter=Chapter 7.5.3, Binary Angular Measure , author-first=Phillip A. , author-last=LaPlante , date=2004 , publisher=Wiley , chapter-url=http://www.globalspec.com/reference/14722/160210/Chapter-7-5-3-Binary-Angular-Measure , isbn=0-471-22855-9 {{cite web , title=Doom 1993 code review - Section "Walls" , author-first=Fabien , author-last=Sanglard , date=2010-01-13 , website=fabiensanglard.net , url=http://fabiensanglard.net/doomIphone/doomClassicRenderer.php {{cite web , title=Hitachi HM55B Compass Module (#29123) , series=Parallax Digital Compass Sensor (#29123) , publisher= Parallax, Inc. , date=May 2005 , website=www.hobbyengineering.com , via=www.parallax.com , url=http://www.hobbyengineering.com/specs/PX-29123.pdf , url-status=dead , archive-url=https://web.archive.org/web/20110711172521/http://www.hobbyengineering.com/specs/PX-29123.pdf , archive-date=2011-07-11 Units of plane angle Binary arithmetic