Oihana PHP Arango

cos.php

Table of Contents

Functions

cos()  : string
Return the cosine of a value.

Functions

cos()

Return the cosine of a value.

cos(string|int|float $value) : string

This helper wraps the ArangoDB AQL function COS(value) which returns the cosine of a value in radians.

Example AQL usage:

COS(0)                  // returns 1
COS(1.5707963267948966) // returns 0 (cos(π/2))
COS(3.141592653589793)  // returns -1 (cos(π))
COS(doc.angle)          // returns cosine of the angle
Parameters
$value : string|int|float

The input value in radians.

Tags
example
use function oihana\arango\db\functions\numerics\cos;

$expr = cos(0);
// Produces: 'COS(0)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#cos
acos()

For the arccosine function.

sin()

For the sine function.

tan()

For the tangent function.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results