Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsTrigonometryValueOperatorstan

tan

open fun <Context : Any> tan(value: Value<Context, Double?>): Value<Context, Double?>

The tangent of a value that is measured in radians.

If the value is null or NaN, it is returned unchanged.

Example

class Triangle(
    val name: String,
    val sideA: Double,
    val sideB: Double,
    val hypotenuse: Double,
    val angleA: Double,
)

collection.aggregate()
    .set {
        Triangle::sideB set (tan(of(Trigonometry::angleA) * of(Trigonometry::sideA)))
    }

External resources