$acosh값의 역쌍곡선 코사인(쌍곡선 아크 코사인)을 반환합니다.
$acosh의 구문은 다음과 같습니다:{ $acosh: <expression> } $acoshtakes any valid expression that resolves to a number between1and+Infinity, e.g.1 <= value <= +Infinity.$acoshreturns values in radians. Use$radiansToDegreesoperator to convert the output value from radians to degrees.By default
$acoshreturns values as adouble.$acoshcan also return values as a 128-bit decimal as long as the<expression>resolves to a 128-bit decimal value.표현식에 대한 자세한 내용은 표현식을 참조하세요 .
행동
null, NaN 및 +/- Infinity
If the argument resolves to a value of null or refers to a field that is missing, $acosh returns null. If the argument resolves to NaN, $acosh returns NaN. If the argument resolves to negative infinity, $acosh throws an error. If the argument resolves to Infinity, $acosh returns Infinity. If the argument resolves to a value outside the bounds of [-1, Infinity] inclusive, $acosh throws an error.
예시 | 결과 | |||
|---|---|---|---|---|
|
| |||
|
| |||
|
| |||
| 다음과 같은 형식의 출력과 유사한 오류 메시지를 표시합니다. |
예시
trigonometry 컬렉션에는 2-D 그래프의 x 축을 따라 값을 저장하는 문서가 포함되어 있습니다.
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : Decimal128("3") }
The following aggregation operation uses the $acosh expression to calculate inverse hyperbolic cosine of x-coordinate and add it to the input document using the $addFields pipeline stage.
db.trigonometry.aggregate([ { $addFields : { "y-coordinate" : { $radiansToDegrees : { $acosh : "$x-coordinate" } } } } ])
The $radiansToDegrees expression converts the radian value returned by $acosh to the equivalent value in degrees.
이 명령은 다음 출력을 반환합니다.
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : Decimal128("3"), "y-coordinate" : Decimal128("100.9979734210524228844295260083432") }
Since x-coordinate is stored as a 128-bit decimal, the output of $acosh is a 128-bit decimal.
trigonometry 컬렉션에는 2-D 그래프의 x 축을 따라 값을 저장하는 문서가 포함되어 있습니다.
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : Decimal128("3") }
The following aggregation operation uses the $acosh expression to calculate inverse hyperbolic cosine of x-coordinate and add it to the input document using the $addFields pipeline stage.
db.trigonometry.aggregate([ { $addFields : { "y-coordinate" : { $acosh : "$x-coordinate" } } } ])
이 명령은 다음 출력을 반환합니다.
{ "_id" : ObjectId("5c50782193f833234ba90d85"), "x-coordinate" : Decimal128("3"), "y-coordinate" : Decimal128("1.762747174039086050465218649959585") }
Since x-coordinate is stored as a 128-bit decimal, the output of $acosh is a 128-bit decimal.