📄 mf_sin.hlp
字号:
{smcl}
{* 25mar2005}{...}
{cmd:help mata sin()}
{hline}
{* index trigonometric functions}{...}
{* index hyperbolic functions}{...}
{* index sin()}{...}
{* index cos()}{...}
{* index tan()}{...}
{* index asin()}{...}
{* index acos()}{...}
{* index atan()}{...}
{* index atan2()}{...}
{* index asinr()}{...}
{* index acosr()}{...}
{* index atanr()}{...}
{* index arg()}{...}
{* index sinh()}{...}
{* index cosh()}{...}
{* index tanh()}{...}
{* index asinh()}{...}
{* index acosh()}{...}
{* index atanh()}{...}
{* index pi()}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] sin() -- Trigonometric and hyperbolic functions}
{title:Syntax}
{p 8 12 2}
{it:numeric matrix} {cmd:sin(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:cos(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:tan(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:asin(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:acos(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:atan(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:real matrix}{bind: }{cmd:atan2(}{it:real matrix X}{cmd:,} {it:real matrix Y}{cmd:)}
{p 8 12 2}
{it:real matrix}{bind: }{cmd:asinr(}{it:real matrix R}{cmd:)}
{p 8 12 2}
{it:real matrix}{bind: }{cmd:acosr(}{it:real matrix R}{cmd:)}
{p 8 12 2}
{it:real matrix}{bind: }{cmd:atanr(}{it:real matrix R}{cmd:)}
{p 8 12 2}
{it:real matrix}{bind: }{cmd:arg(}{it:complex matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:sinh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:cosh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:tanh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:asinh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:acosh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:numeric matrix} {cmd:atanh(}{it:numeric matrix Z}{cmd:)}
{p 8 12 2}
{it:real scalar}{bind: }{cmd:pi()}
{title:Description}
{p 4 4 2}
{cmd:sin(}{it:Z}{cmd:)}, {cmd:cos(}{it:Z}{cmd:)}, and
{cmd:tan(}{it:Z}{cmd:)} return the appropriate trigonometric function.
Angles are measured in radians. All return real if argument is real,
complex if argument is complex.
{p 4 4 2}
{cmd:asin(}{it:Z}{cmd:)} returns arcsine in the range -pi/2 to pi/2.
Returned value is real if argument is real, complex if argument is
complex.
{p 4 4 2}
{cmd:acos(}{it:Z}{cmd:)} returns arccosine in the range 0 to pi.
Returned value is real if argument is real, complex if argument is
complex.
{p 4 4 2}
{cmd:atan(}{it:Z}{cmd:)} returns arctangent in the range -pi/2 to pi/2.
Returned value real if argument is real, complex if argument is
complex.
{p 4 4 2}
Warning: {cmd:asin()}, {cmd:acos()}, and {cmd:atan()} base their
result on whether the input is real or complex. Thus
{cmd:acos(2)} == . while {cmd:acos(2+0i)} == -1.317i.
{p 4 4 2}
{cmd:atan2(}{it:x}{cmd:,} {it:y}{cmd:)} returns the radian value
in the range (-pi, pi] of the angle of the vector determined by
({it:x},{it:y}); the result being in the range [0,pi] for
quadrants 1 and 2 and [0,-pi) in quadrants 4 and 3. Note that {it:x}
and {it:y} are real; also see related function {cmd:arg()} below;
{cmd:atan2(}{it:x}{cmd:,} {it:y}{cmd:)} is equivalent to
{cmd:arg(C(}{it:x}{cmd:,} {it:y}{cmd:))}.
{p 4 4 2}
{cmd:asinr(}{it:R}{cmd:)}, {cmd:acosr(}{it:R}{cmd:)}, and
{cmd:atanr(}{it:R}{cmd:)} the real-only variants of {cmd:asin()},
{cmd:acos()}, and {cmd:atan()}. {cmd:asin()}, {cmd:acos()}, and
{cmd:atan()} examine the received argument and, if it is real, call
the appropriate real function. Thus use of {cmd:asinr()},
{cmd:acosr()}, and {cmd:atanr()} in place of {cmd:asin()},
{cmd:acos()}, and {cmd:atan()} when arguments are known to be real
will speed execution, but not by much. We recommend use of
{cmd:asin()}, {cmd:acos()}, and {cmd:atan()} in all cases.
{p 4 4 2}
{cmd:arg(}{it:Z}{cmd:)} returns the arctangent of
Im({it:Z})/Re({it:Z}) in the correct quadrant, the result being in the
range (-pi, pi]; [0,pi] in quadrants 1 and 2 and [0,-pi) in quadrants
4 and 3. Also see related function {cmd:atan2()} above;
{cmd:arg(}{it:Z}{cmd:)} is equivalent to
{cmd:atan2(Re(}{it:Z}{cmd:), Im(}{it:Z}{cmd:))}.
{p 4 4 2}
{cmd:sinh(}{it:Z}{cmd:)}, {cmd:cosh(}{it:Z}{cmd:)}, and
{cmd:tanh(}{it:Z}{cmd:)} return the hyperbolic sine, cosine, and
tangent, respectively. Returned value is real if argument is real,
complex if complex.
{p 4 4 2}
{cmd:asinh(}{it:Z}{cmd:)}, {cmd:acosh(}{it:Z}{cmd:)}, and
{cmd:atanh(}{it:Z}{cmd:)} return the inverse hyperbolic sine, cosine,
and tangent, respectively. Returned value is real if argument is
real, complex if complex. See warning above for {cmd:asin()}, etc.
This warning applies here.
{p 4 4 2}
{cmd:pi()} returns the value of pi.
{title:Conformability}
{p 4 4 2}
{cmd:atan2(}{it:x}{cmd:,} {it:y}{cmd:)}:
{p_end}
{it:x}: {it:r1 x c1}
{it:y}: {it:r2 x c2}, {it:x} and {it:y} r-conformable
{it:result}: max({it:r1},{it:r2}) {it:x} max({it:c1},{it:c2})
{p 4 4 2}
{cmd:pi()} returns a 1 {it:x} 1 scalar.
{p 4 4 2}
All other functions return a matrix of the same dimension as input,
containing element-by-element calculated results.
{title:Diagnostics}
{p 4 4 2}
{cmd:tan(}{it:Z}{cmd:)} returns missing when
{cmd:cos(}{it:Z}{cmd:)}==0.
{p 4 4 2}
All functions return missing for real arguments when the result
would be complex, but return the appropriate complex result when
given a complex argument.
{title:Source code}
{p 4 4 2}
{view asin.mata, adopath asis:asin.mata},
{view acos.mata, adopath asis:acos.mata},
{view atan.mata, adopath asis:atan.mata},
{view sinh.mata, adopath asis:sinh.mata},
{view cosh.mata, adopath asis:cosh.mata},
{view tanh.mata, adopath asis:tanh.mata},
{view asinh.mata, adopath asis:asinh.mata},
{view acosh.mata, adopath asis:acosh.mata},
{view atanh.mata, adopath asis:atanh.mata},
{view pi.mata, adopath asis:pi.mata};
remaining functions are built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] sin()}
{p 4 13 2}
Online: help for
{bf:{help m4_scalar:[M-4] scalar}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -