다음: , 이전: , 상위 문서: Arithmetic   [차례][찾아보기]


17.3 Trigonometry

Octave provides the following trigonometric functions where angles are specified in radians. To convert from degrees to radians multiply by pi/180 or use the deg2rad function. For example, sin (30 * pi/180) returns the sine of 30 degrees. As an alternative, Octave provides a number of trigonometric functions which work directly on an argument specified in degrees. These functions are named after the base trigonometric function with a ‘d’ suffix. As an example, sin expects an angle in radians while sind expects an angle in degrees.

Octave uses the C library trigonometric functions. It is expected that these functions are defined by the ISO/IEC 9899 Standard. This Standard is available at: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf. Section F.9.1 deals with the trigonometric functions. The behavior of most of the functions is relatively straightforward. However, there are some exceptions to the standard behavior. Many of the exceptions involve the behavior for -0. The most complex case is atan2. Octave exactly implements the behavior given in the Standard. Including atan2(+- 0, 0) returns +- pi.

It should be noted that 매트랩 uses different definitions which apparently do not distinguish -0.

rad = deg2rad (deg)

Convert degrees to radians.

The input deg must be a scalar, vector, or N-dimensional array of double or single floating point values. deg may be complex in which case the real and imaginary components are converted separately.

The output rad is the same size and shape as deg with degrees converted to radians using the conversion constant pi/180.

Example:

deg2rad ([0, 90, 180, 270, 360])
  ⇒  0.00000   1.57080   3.14159   4.71239   6.28319

같이 보기: rad2deg.

deg = rad2deg (rad)

Convert radians to degrees.

The input rad must be a scalar, vector, or N-dimensional array of double or single floating point values. rad may be complex in which case the real and imaginary components are converted separately.

The output deg is the same size and shape as rad with radians converted to degrees using the conversion constant 180/pi.

Example:

rad2deg ([0, pi/2, pi, 3/2*pi, 2*pi])
  ⇒  0    90   180   270   360

같이 보기: deg2rad.

sin (가로)

Compute the sine for each element of 가로 in radians.

같이 보기: asin, sind, sinh.

cos (가로)

Compute the cosine for each element of 가로 in radians.

같이 보기: acos, cosd, cosh.

tan (z)

Compute the tangent for each element of 가로 in radians.

같이 보기: atan, tand, tanh.

sec (가로)

Compute the secant for each element of 가로 in radians.

같이 보기: asec, secd, sech.

csc (가로)

Compute the cosecant for each element of 가로 in radians.

같이 보기: acsc, cscd, csch.

cot (가로)

Compute the cotangent for each element of 가로 in radians.

같이 보기: acot, cotd, coth.

asin (가로)

Compute the inverse sine in radians for each element of 가로.

같이 보기: sin, asind.

acos (가로)

Compute the inverse cosine in radians for each element of 가로.

같이 보기: cos, acosd.

atan (가로)

Compute the inverse tangent in radians for each element of 가로.

같이 보기: tan, atand.

asec (가로)

Compute the inverse secant in radians for each element of 가로.

같이 보기: sec, asecd.

acsc (가로)

Compute the inverse cosecant in radians for each element of 가로.

같이 보기: csc, acscd.

acot (가로)

Compute the inverse cotangent in radians for each element of 가로.

같이 보기: cot, acotd.

sinh (가로)

Compute the hyperbolic sine for each element of 가로.

같이 보기: asinh, cosh, tanh.

cosh (가로)

Compute the hyperbolic cosine for each element of 가로.

같이 보기: acosh, sinh, tanh.

tanh (가로)

Compute hyperbolic tangent for each element of 가로.

같이 보기: atanh, sinh, cosh.

sech (가로)

Compute the hyperbolic secant of each element of 가로.

같이 보기: asech.

csch (가로)

Compute the hyperbolic cosecant of each element of 가로.

같이 보기: acsch.

coth (가로)

Compute the hyperbolic cotangent of each element of 가로.

같이 보기: acoth.

asinh (가로)

Compute the inverse hyperbolic sine for each element of 가로.

같이 보기: sinh.

acosh (가로)

Compute the inverse hyperbolic cosine for each element of 가로.

같이 보기: cosh.

atanh (가로)

Compute the inverse hyperbolic tangent for each element of 가로.

같이 보기: tanh.

asech (가로)

Compute the inverse hyperbolic secant of each element of 가로.

같이 보기: sech.

acsch (가로)

Compute the inverse hyperbolic cosecant of each element of 가로.

같이 보기: csch.

acoth (가로)

Compute the inverse hyperbolic cotangent of each element of 가로.

같이 보기: coth.

atan2 (세로, 가로)

Compute atan (세로 / 가로) for corresponding elements of 세로 and 가로.

세로 and 가로 must match in size and orientation. The signs of elements of 세로 and 가로 are used to determine the quadrants of each resulting value.

This function is equivalent to arg (complex (가로, 세로)).

같이 보기: tan, tand, tanh, atanh.

Octave provides the following trigonometric functions where angles are specified in degrees. These functions produce true zeros at the appropriate intervals rather than the small round-off error that occurs when using radians. For example:

cosd (90)
     ⇒ 0
cos (pi/2)
     ⇒ 6.1230e-17
sind (가로)

Compute the sine for each element of 가로 in degrees.

Returns zero for elements where 가로/180 is an integer.

같이 보기: asind, sin.

cosd (가로)

Compute the cosine for each element of 가로 in degrees.

Returns zero for elements where (가로-90)/180 is an integer.

같이 보기: acosd, cos.

tand (가로)

Compute the tangent for each element of 가로 in degrees.

Returns zero for elements where 가로/180 is an integer and Inf for elements where (가로-90)/180 is an integer.

같이 보기: atand, tan.

secd (가로)

Compute the secant for each element of 가로 in degrees.

같이 보기: asecd, sec.

cscd (가로)

Compute the cosecant for each element of 가로 in degrees.

같이 보기: acscd, csc.

cotd (가로)

Compute the cotangent for each element of 가로 in degrees.

같이 보기: acotd, cot.

asind (가로)

Compute the inverse sine in degrees for each element of 가로.

같이 보기: sind, asin.

acosd (가로)

Compute the inverse cosine in degrees for each element of 가로.

같이 보기: cosd, acos.

atand (가로)

Compute the inverse tangent in degrees for each element of 가로.

같이 보기: tand, atan.

atan2d (세로, 가로)

Compute atan (세로 / 가로) in degrees for corresponding elements from 세로 and 가로.

같이 보기: tand, atan2.

asecd (가로)

Compute the inverse secant in degrees for each element of 가로.

같이 보기: secd, asec.

acscd (가로)

Compute the inverse cosecant in degrees for each element of 가로.

같이 보기: cscd, acsc.

acotd (가로)

Compute the inverse cotangent in degrees for each element of 가로.

같이 보기: cotd, acot.


다음: , 이전: , 상위 문서: Arithmetic   [차례][찾아보기]