$asinh(集計)
$asinh
Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value.
$asinh
の構文は次のとおりです。{ $asinh: <expression> } $asinh
takes any valid 式 that resolves to a number.$asinh
はラジアン単位で値を返します。$radiansToDegrees
演算子を使用して出力値をラジアンから度に変換します。デフォルトでは、
$asinh
は値をdouble
として返します。$asinh
は、<expression>
が128ビットの 10 進数値に解決される限り、 128ビットの 10 進数として値を返すこともできます。
式の詳細については、「式 」を参照してください。
動作
null
、NaN
、+/- Infinity
If the argument resolves to a value of null
or refers to a field
that is missing, $asinh
returns null
. If the
argument resolves to NaN
, $asinh
returns NaN
.
If the argument resolves to negative or positive infinity,
$asinh
returns negative or positive infinity respectively.
例 | 結果 |
---|---|
|
|
|
|
|
|
|
|
例
trigonometry
コレクションには、 2 -D グラフのx
軸に沿って値を保存するドキュメントが含まれています。
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : NumberDecimal("1") }
The following aggregation operation uses the
$asinh
expression to calculate inverse hyperbolic
sine of x-coordinate
and add it to the input document using
the $addFields
pipeline stage.
db.trigonometry.aggregate([ { $addFields : { "y-coordinate" : { $radiansToDegrees : { $asinh : "$x-coordinate" } } } } ])
$radiansToDegrees
式は、 $asinh
によって返されたラジアン値を度単位の同等の値に変換します。
このコマンドは、次の出力を返します。
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : NumberDecimal("1"), "y-coordinate" : NumberDecimal("50.49898671052621144221476300417157") }
x-coordinate
は128ビットの 10 進数として保存されているため、 $asinh
の出力は128ビットの 10 進数になります。
trigonometry
コレクションには、 2 -D グラフのx
軸に沿って値を保存するドキュメントが含まれています。
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : NumberDecimal("1") }
The following aggregation operation uses the
$asinh
expression to calculate inverse hyperbolic
sine of x-coordinate
and add it to the input document using
the $addFields
pipeline stage.
db.trigonometry.aggregate([ { $addFields : { "y-coordinate" : { $asinh : "$x-coordinate" } } } ])
このコマンドは、次の出力を返します。
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : NumberDecimal("1"), "y-coordinate" : NumberDecimal("1.818446459232066823483698963560709") }
x-coordinate
は128ビットの 10 進数として保存されているため、 $asinh
の出力は128ビットの 10 進数になります。