Docs Menu

$sinh(集計)

項目一覧

$sinh

Returns the hyperbolic sine of a value that is measured in radians.

$sinhの構文は次のとおりです。

{ $sinh: <expression> }

$sinhは、ラジアンで測定された数値に変換される有効なであればどれでもかまいません。 式が値を度単位で返す場合は、 $degreesToRadians演算子を使用して値をラジアンに変換します。

デフォルトでは、 $sinhは値をdoubleとして返します。 $sinhは、 <expression>が128ビットの 10 進数値に解決される場合は、 128ビットの 10 進数として値を返すこともできます。

式の詳細については、「式 」を参照してください。

If the input argument resolves to a value of null or refers to a field that is missing, $sinh returns null. If the argument resolves to NaN, $sinh returns NaN. If the argument resolves to negative or positive Infinity, $sinh returns negative or positive Infinity respectively.

結果

{ $sinh: NaN }

NaN

{ $sinh: null }

null

{ $sinh: -Infinity }

-Infinity

{ $sinh: Infinity }

Infinity

次のtrigonometryコレクションには、度単位で測定されたangle値を保存するドキュメントが含まれています。

db.trigonometry.insertOne(
{
"_id" : ObjectId( "5c50782193f833234ba90d25" ),
"angle" : NumberDecimal( "53.1301023541559787031443874490659" )
}
)

The following aggregation operation uses the $sinh expression to calculate the hyperbolic sine of angle and adds it to the input document using the $addFields pipeline stage:

db.trigonometry.aggregate( [
{
$addFields : {
"sinh_output" : { $sinh : { $degreesToRadians : "$angle" } }
}
}
] )

$degreesToRadians式は、 angleを度単位でラジアンに変換します。

出力例:

{
"_id" : ObjectId("5c50782193f833234ba90d25"),
"angle" : NumberDecimal("53.1301023541559787031443874490659"),
"sinh_output" : NumberDecimal("1.066020404405732132503284522731829")
}

angle128ビットの 10 進数として保存されるため、 $sinhの出力も128ビットの 10 進数になります。

次のtrigonometryコレクションには、ラジアンで測定されたangle値を保存するドキュメントが含まれています。

db.trigonometry.insertOne(
{
"_id" : ObjectId( "5c50782193f833234ba90d35" ),
"angle" : NumberDecimal( "1.6301023541559787031443874490659" )
}
)

The following aggregation operation uses the $sinh expression to calculate the hyperbolic sine of angle and adds it to the input document using the $addFields pipeline stage:

db.trigonometry.aggregate( [
{
$addFields : {
"sinh_output" : { $sinh : "$angle" }
}
}
] )

出力例:

{
"_id" : ObjectId("5c50782193f833234ba90d35"),
"angle" : NumberDecimal("1.6301023541559787031443874490659"),
"sinh_output" : NumberDecimal("2.454243813557362033961729701069671")
}

angle128ビットの 10 進数として保存されるため、 $sinhの出力も128ビットの 10 進数になります。

項目一覧