JPH01109428A - Trigonometric function arithmetic unit - Google Patents

Trigonometric function arithmetic unit

Info

Publication number
JPH01109428A
JPH01109428A JP26536587A JP26536587A JPH01109428A JP H01109428 A JPH01109428 A JP H01109428A JP 26536587 A JP26536587 A JP 26536587A JP 26536587 A JP26536587 A JP 26536587A JP H01109428 A JPH01109428 A JP H01109428A
Authority
JP
Japan
Prior art keywords
value
trigonometric function
dividing
values
sine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP26536587A
Other languages
Japanese (ja)
Inventor
Hiroko Ichikawa
裕子 市川
Tatsuya Yaguchi
達也 矢口
Yutaka Inoue
豊 井上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP26536587A priority Critical patent/JPH01109428A/en
Publication of JPH01109428A publication Critical patent/JPH01109428A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To calculate a highly accurate trigonometric function value with a small quantity of a storing area and a small calculation quantity by dividing a given argument into a prescribed equally divided angle, using the sine value or cosine value of the divided equally divided angle and adding, subtracting, multiplying and dividing in accordance with the addition theorem of the trigonometric function. CONSTITUTION:In a table 121 of a table ROM 12, for example, a sine value and a cosine value to values a0-aN-1 to (n)-equally-divide 2pi are stored and the sine value and the cosine value to values b0-bM-1 to (m)-equally-divide further (a) are stored in a table 122. A control part 10 determines a1 which becomes a1<=X<a1+1 from an argument X inputted from an input part 13 and bj which becomes bj<=b<j+1 for b=x-a1, reads the sine value and the cosine value for ai and bj from the table ROM 12, outputs these values to a computing element 15, executes the calculation with the addition theorem and outputs the result to an output part 14. Thus, the data quantity of the table ROM can be reduced and a short operation time can be sufficient.

Description

【発明の詳細な説明】 [a業上の利用分野] 本発明は引数と求める三角関数を入力し、三角関数の計
算を行う三角関数演算装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application in Business A] The present invention relates to a trigonometric function calculation device that receives arguments and trigonometric functions to be sought and calculates the trigonometric functions.

[従来の技術] 計算機等で、与えられた引数に対応する正弦値又は余弦
値等の三角関数の計算を行う場合、従来は予め引数に対
応する正弦値や余弦値をテーブル等の記憶領域に記憶さ
せておき、それらを参照して計算を行っていた。また、
このようなテーブルを使用しない場合は、有理関数式で
近似する方法等が用いられていた。
[Prior Art] When calculating a trigonometric function such as a sine value or a cosine value corresponding to a given argument using a calculator, conventionally, the sine value or cosine value corresponding to the argument is stored in a storage area such as a table in advance. I memorized them and used them to perform calculations. Also,
When such a table is not used, methods such as approximation using rational function expressions have been used.

[発明が解決しようとする問題点] しかしながら、前者のテーブル参照方式で三角関数の計
算を行い、その精度を上げようとすると莫大な記憶領域
が必要になる。一方、後者の近似法で精度上げようとす
ると計算量が多くなるため計算時間が長くなるという欠
点があった。
[Problems to be Solved by the Invention] However, when calculating trigonometric functions using the former table reference method and attempting to improve its accuracy, a huge amount of storage space is required. On the other hand, if the latter approximation method were used to improve accuracy, the amount of calculation would increase, resulting in a longer calculation time.

本発明は上記従来例に鑑みてなされたもので、少ない記
憶領域と少ない計算量で、精度の高い三角関数値を算出
できる三角関数演算装置を提供することを目的とする。
The present invention has been made in view of the above conventional example, and an object of the present invention is to provide a trigonometric function calculation device that can calculate highly accurate trigonometric function values with a small storage area and a small amount of calculation.

[問題点を解決するための手段] 上記目的を達成するために本発明の三角関数演算装置は
以下のような構成からなる。即ち、入力された引数に対
応して、指示された三角関数の計算を行う三角関数演算
装置であって、所定角度をn等分した第1の等分角と、
該第1の等分角を更にm等分した第2の等分角のそれぞ
れの、少なくとも正弦値或いは余弦値を記憶する記憶手
段と、前記引数を前記第1と第2の等分角に分割する分
割手段と、分割された前記第1と第2の等分角の正弦値
或いは余弦値を用い、前記三角関数の加法定理に従って
加減乗除により前記三角関数の値を算出する算出手段と
を備える。
[Means for Solving the Problems] In order to achieve the above object, the trigonometric function calculation device of the present invention has the following configuration. That is, it is a trigonometric function calculation device that calculates a specified trigonometric function in response to an input argument, the device comprising: a first equal dividing angle obtained by dividing a predetermined angle into n equal parts;
a storage means for storing at least a sine value or a cosine value of each of second equal angles obtained by further dividing the first equal angle into m equal parts; a dividing means for dividing, and a calculating means for calculating the value of the trigonometric function by addition, subtraction, multiplication, and division according to the addition theorem of the trigonometric function using the sine value or cosine value of the divided first and second equal angles. Be prepared.

[作用] 以上の構成において、所定角度をn等分した第1の等分
角と、その第1の等分角を更にm等分した第2の等分角
のそれぞれの、少なくとも正弦値と余弦値のいずれかを
記憶手段に記憶しておく。
[Operation] In the above configuration, at least the sine value of each of the first equal dividing angle obtained by dividing the predetermined angle into n equal parts and the second equal dividing angle obtained by further dividing the first equal dividing angle into m equal parts. One of the cosine values is stored in a storage means.

与えられた引数を第1と第2の等分角に分割し、分割さ
れた第1と′!J2の等分角の正弦値或いは余弦値を用
い、三角関数の加法定理に従って加減乗除により三角関
数の値を算出するように動作する。
Divide the given argument into the first and second equal angles, and divide the first and '! Using the sine value or cosine value of the equidistant angle J2, it operates to calculate the value of the trigonometric function by addition, subtraction, multiplication, and division according to the addition theorem of trigonometric functions.

[実施例] 以下、添付図面を参照して本発明の好適な実施例を詳細
に説明する。
[Embodiments] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[演算装置の説明 (第1図)] 第1図は実施例の演算装置の構成を示すブロック図であ
る。
[Description of the arithmetic device (FIG. 1)] FIG. 1 is a block diagram showing the configuration of the arithmetic device of the embodiment.

図中、10は例えばマイクロプロセッサ等のCPUを備
えた制御部で、そのCPUはプログラムROMIIに記
憶され、第2図のフローチャートで示された制御プログ
ラムに従って各種制御信号を出力して装置全体の制御を
行っている。12は後述する正弦値や余弦値を格納して
いるテーブルROMで、三角関数の演算時に参照される
In the figure, 10 is a control unit equipped with a CPU such as a microprocessor, and the CPU is stored in a program ROMII and outputs various control signals according to the control program shown in the flowchart of FIG. 2 to control the entire device. It is carried out. A table ROM 12 stores sine values and cosine values, which will be described later, and is referenced when calculating trigonometric functions.

13は引数や、求めたい三角関数の種類(正弦、余弦ま
たは正接)等を入力する入力部で、例えばキーボード等
で構成されている。14は計算結果を表示出力する出力
部で、例えばLEDやCRT等のデイスプレィやプリン
タ等で構成されている。15は加減乗除の計算を行う演
算部で、制御部10より与えられた正弦値や余弦値等を
基に、それらの値の乗算や加算等を行い、その結果を制
御部10に出力する。
Reference numeral 13 denotes an input unit for inputting arguments, the type of trigonometric function desired (sine, cosine, or tangent), etc., and is comprised of, for example, a keyboard. Reference numeral 14 denotes an output unit for displaying and outputting calculation results, and is comprised of, for example, a display such as an LED or CRT, a printer, or the like. Reference numeral 15 denotes an arithmetic unit that performs calculations of addition, subtraction, multiplication, and division, and based on the sine value, cosine value, etc. given from the control unit 10, multiplies and adds these values, and outputs the results to the control unit 10.

[計算方法の説明 (第2図、第3図)]第2図は実施
例の演算装置における正弦値を算出する制御プログラム
のフローチャートで、本プログラムは人力部13より引
数が入力されて、演算する三角関数の種類が指示される
ことにより開始される。
[Description of calculation method (Figs. 2 and 3)] Fig. 2 is a flowchart of a control program for calculating a sine value in the calculation device of the embodiment. The process starts when the type of trigonometric function to be used is specified.

まずステップS1で入力部13より引数Xと求めたい三
角関数の種類(正弦(sin ) )が入力されるとス
テップS2に進む。
First, in step S1, the argument X and the type of trigonometric function to be obtained (sin) are input from the input unit 13, and the process proceeds to step S2.

本実施例は、引数X=a+bとすると、sin (X)
xsin (a)−cos (b)+cos (a) 
−s i n (b)の加法定理よりs i n (X
)の値を求めるものである。
In this example, if the argument X=a+b, then sin (X)
xsin (a)-cos (b)+cos (a)
−s i n (b) From the addition theorem, sin (X
).

テーブルROM12のテーブル121には、2πをn等
分した値(小さいほうからa Or a In a 2
+・・・+aN−1)に対する正弦値及び余弦値を格納
し、テーブル122にはaを更にm等分した値(小さい
ほうからす、、b、、・・・bM−1)に対する正弦値
と余弦値とを格納している。尚、これらa0〜a N−
11b o Nb M−1はラジアンの値である。
The table 121 of the table ROM 12 contains values obtained by dividing 2π into n equal parts (from the smallest to a Or a In a 2
+...+aN-1), and the table 122 stores the sine and cosine values for the values obtained by further dividing a into m equal parts (smaller glass, b,... bM-1). and cosine value are stored. In addition, these a0 to a N-
11b o Nb M-1 is a value in radians.

従って、ステップS2では引数Xより、al≦X<at
++ となるal と、bxx−ai に対して、bj
≦1) < 1) J*I となるbjを決定する。
Therefore, in step S2, from the argument X, al≦X<at
++ for al and bxx-ai, bj
≦1) <1) Determine bj that satisfies J*I.

第3図はこれらaとbの数値例を示す図で、30はaの
数値例、31はbの数値例を示している。
FIG. 3 is a diagram showing numerical examples of these a and b, where 30 shows a numerical example of a, and 31 shows a numerical example of b.

ここでは、2π(=ラジアンで約6.28)とし、2π
を4等分した値としてaを決定している。よって、a 
oso、oo、 a 、−1,57,a 2−3.14
゜a 、−4,71となる。また、bはaの間隔″1,
57”を、例えば更に157等分した値として与えられ
、b o=o、ol、 b r 、−0,02,b z
”o、03. +*+ 。
Here, we assume 2π (= about 6.28 in radians), and 2π
a is determined by dividing the value into four equal parts. Therefore, a
oso, oo, a, -1,57,a 2-3.14
°a becomes -4,71. In addition, b is the interval of a ``1,''
57" is further divided into 157 equal parts, b o = o, ol, b r , -0,02, b z
"o, 03. +*+.

b 、s、−1,58となっている。b, s, -1,58.

よって、いまステップS1で引数としてX=2及び5i
nXの計算が指示されると、ステップS2では、ai 
としてa、=1.57が選択される(a+≦2くa、)
、またbJはb−2−1,57=0.43より、bJ2
が選択される。
Therefore, now in step S1, X=2 and 5i are used as arguments.
When the calculation of nX is instructed, in step S2, ai
As such, a,=1.57 is selected (a+≦2×a,)
, and bJ is b-2-1,57=0.43, so bJ2
is selected.

こうして次にステップS3で、al+b42に対する正
弦値と余弦値、sin (1,57)、cos(1,5
7)、Sin (0,43)及びcos(0,43)の
値をテーブルROM12より読み出し、それぞれを Aws i n (1,57) B=cos (1,57) C−s i n (0,43) D=cos (0,43) とする。
In this way, in step S3, the sine and cosine values for al+b42, sin (1, 57), cos (1, 5
7), the values of sin (0, 43) and cos (0, 43) are read from the table ROM 12, and each is Aws in (1, 57) B=cos (1, 57) C-s in (0, 43) Let D=cos (0,43).

ステップS4ではこれらANDの値を演算器15に出力
して、AxD+BxCの計算を行い、その結果をs i
 n (X)の計算結果として出力部14に出力する。
In step S4, these AND values are output to the arithmetic unit 15 to calculate AxD+BxC, and the result is s i
It is output to the output unit 14 as the calculation result of n (X).

こうすることにより、例えば2π分のラジアン値(小数
点以下2桁まで)のテーブルを設けるとπ=3.14と
して全体で629のテーブルを要するのに対し、本実施
例によればaのテーブル数が4、bのテーブル数が15
7の、合計161のテーブル(161/629〜1/4
)で足りることになる。
By doing this, for example, if a table of radian values for 2π (up to two digits after the decimal point) is provided, a total of 629 tables would be required as π = 3.14, but according to this embodiment, the number of tables for a is is 4, and the number of tables in b is 15.
7, a total of 161 tables (161/629 to 1/4
) will be sufficient.

また、π/2以上の引数Xに対しては、re / 2 
< X < tt:では、5in(X)・51n(yr
/2−X)tt < X < 3 π/ 2では、si
n (X) ・−5In (X−7! /2)3π/ 
2<X<2πでは、51n(X)−sin(2yr−X
)という関係式を用いることによって、テーブルROM
12に記憶しておく正弦値及び余弦値の量は、2πまで
必要でなく、その1/4で済むことになる。
Furthermore, for an argument X greater than or equal to π/2, re/2
< X < tt: Then, 5in(X)・51n(yr
/2-X)tt < X < 3 π/2, si
n (X) ・-5In (X-7! /2)3π/
For 2<X<2π, 51n(X)-sin(2yr-X
) By using the relational expression, table ROM
The amount of sine and cosine values to be stored in 12 does not need to be up to 2π, and can be 1/4 of that.

更に、 c o s  (X)  ms i n  (π/2−
X)の関係より、正弦値のみのテーブルを持たせておく
だけで余弦値も求めることができるため、テーブルRO
Mのデータ量を更に1/2にすることができる。
Furthermore, cos (X) ms in (π/2−
From the relationship of
The data amount of M can be further reduced to 1/2.

尚、本実施例では正弦値のみを持たせるように説明した
が、cos (X) =sin (tt /2−X)の
関係より、余弦値のみのテーブルを持たせるようにして
もよいことはもちろんである。
In addition, although this embodiment has been explained so as to have only sine values, it is also possible to have a table of only cosine values from the relationship cos (X) = sin (tt /2-X). Of course.

以上説明したように本実施例によれば、従来のテーブル
ROMのデータ量を大幅に減少することができ゛、演算
も加減算と乗算だけで達成できるため、演算に要する時
間もはるかに少なくて済む効果がある。
As explained above, according to this embodiment, the amount of data in the conventional table ROM can be significantly reduced, and since calculations can be accomplished only by addition, subtraction and multiplication, the time required for calculations is also much shorter. effective.

[発明の効果] 以上説明したように本発明によれば、正弦値や余弦値等
のデータテーブルの量を少なくできるととともに、高速
に三角関数の演算ができるという効果がある。
[Effects of the Invention] As described above, according to the present invention, the amount of data tables such as sine values and cosine values can be reduced, and trigonometric function calculations can be performed at high speed.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は実施例の演算装置の構成を示すブロック図、 第2図は実施例の正弦値を求めるフローチャート、 第3図は実施例に招けるaとbの値の具体例を示す図で
ある。 図中、t o−・・制御部、11・・・プログラムRO
M112・・・テーブルROM、13・・・入力部、1
4・・・出力部、15−・・演算部である。 1を 第1図 第2図 第3図
Fig. 1 is a block diagram showing the configuration of the arithmetic device of the embodiment, Fig. 2 is a flowchart for calculating the sine value of the embodiment, and Fig. 3 is a diagram showing a specific example of the values of a and b that can be used in the embodiment. be. In the figure, t o--control unit, 11- program RO
M112...Table ROM, 13...Input section, 1
4--Output section, 15--Arithmetic section. Figure 1 Figure 2 Figure 3

Claims (2)

【特許請求の範囲】[Claims] (1)入力された引数に対応して、指示された三角関数
の計算を行う三角関数演算装置であつて、 所定角度をn等分した第1の等分角と、該第1の等分角
を更にm等分した第2の等分角のそれぞれの、少なくと
も正弦値或いは余弦値を記憶する記憶手段と、前記引数
を前記第1と第2の等分角に分割する分割手段と、分割
された前記第1と第2の等分角の正弦値或いは余弦値を
用い、前記三角関数の加法定理に従つて加減乗除により
前記三角関数の値を算出する算出手段とを備えることを
特徴とする三角関数演算装置。
(1) A trigonometric function calculation device that calculates a specified trigonometric function in response to an input argument, the device comprising: a first equal dividing angle obtained by dividing a predetermined angle into n equal parts, and the first equal dividing angle. storage means for storing at least the sine value or cosine value of each of the second equal angles obtained by further dividing the angle into m equal parts; and a dividing means for dividing the argument into the first and second equal angles; Calculating means for calculating the value of the trigonometric function by addition, subtraction, multiplication, and division according to the addition theorem of the trigonometric function using the sine value or cosine value of the divided first and second equal angles. A trigonometric function calculation device.
(2)前記所定角度はπ/2の整数倍の角度であること
を特徴とする特許請求の範囲第1項に記載の三角関数演
算装置。
(2) The trigonometric function calculation device according to claim 1, wherein the predetermined angle is an angle that is an integral multiple of π/2.
JP26536587A 1987-10-22 1987-10-22 Trigonometric function arithmetic unit Pending JPH01109428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26536587A JPH01109428A (en) 1987-10-22 1987-10-22 Trigonometric function arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26536587A JPH01109428A (en) 1987-10-22 1987-10-22 Trigonometric function arithmetic unit

Publications (1)

Publication Number Publication Date
JPH01109428A true JPH01109428A (en) 1989-04-26

Family

ID=17416165

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26536587A Pending JPH01109428A (en) 1987-10-22 1987-10-22 Trigonometric function arithmetic unit

Country Status (1)

Country Link
JP (1) JPH01109428A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04112320A (en) * 1990-09-03 1992-04-14 Nec Ic Microcomput Syst Ltd Trigonometrical function arithmetic device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS583038A (en) * 1981-06-30 1983-01-08 Fujitsu Ltd Table reference type trigonometrical function operation system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS583038A (en) * 1981-06-30 1983-01-08 Fujitsu Ltd Table reference type trigonometrical function operation system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04112320A (en) * 1990-09-03 1992-04-14 Nec Ic Microcomput Syst Ltd Trigonometrical function arithmetic device

Similar Documents

Publication Publication Date Title
US3256424A (en) Digital curve computer for use in controlling the path of a work tool or work piece
GB1063014A (en) Improvements in or relating to electronic digital computers
Engelman MATHLAB: a program for on-line machine assistance in symbolic computations
Herbison-Evans Solving quartics and cubics for graphics
JPH01109428A (en) Trigonometric function arithmetic unit
JPH01259420A (en) Trigonometric function arithmetic unit
JPS6012669B2 (en) Calculator addressing scheme
US3939330A (en) Vector conversion system
Pearson On the Construction of Tables and on Interpolation
JPS6035701B2 (en) Date information processing device
Stewart On Lehmer’s method for finding the zeros of a polynomial
Huskey Technical Developments: Characteristics of the Institute for Numerical Analysis Computer
CN110633453A (en) Atmospheric parameter calculation and airspeed conversion program calculation method
US4308449A (en) Tactical nuclear slide rule
US4409668A (en) Round-off apparatus for data processors
JPH04436Y2 (en)
Andrews et al. Evaluation of functions on microcomputers: square root
Holin Harthong-Reeb analysis and digital circles
Klein A program for an airborne digital control system
JP3978879B2 (en) COMPUTER DEVICE AND RECORDING MEDIUM CONTAINING COMPUTER PROCESSING PROGRAM
JP2022012588A (en) calculator
Kodres et al. Design study of an avionics navigation microcomputer
JPH021627Y2 (en)
Ehrman “Logical” arithmetic on computers with two's complement binary arithmetic
JPH074670Y2 (en) Small electronic calculator with ratio calculation function