Tangent
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- atan() : array<string|int, mixed>|float|string
- ATAN.
- atan2() : array<string|int, mixed>|float|string
- ATAN2.
- atanh() : array<string|int, mixed>|float|string
- ATANH.
- tan() : array<string|int, mixed>|float|string
- TAN.
- tanh() : array<string|int, mixed>|float|string
- TANH.
- evaluateArrayArguments() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
- evaluateArrayArgumentsIgnore() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
- evaluateArrayArgumentsSubset() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
- evaluateArrayArgumentsSubsetFrom() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
- evaluateSingleArgumentArray() : array<string|int, mixed>
- Handles array argument processing when the function accepts a single argument that can be an array argument.
- initialiseHelper() : void
- testFalse() : bool
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
atan()
ATAN.
public
static atan(array<string|int, mixed>|float $number) : array<string|int, mixed>|float|string
Returns the arctangent of a number.
Parameters
- $number : array<string|int, mixed>|float
-
Number, or can be an array of numbers
Return values
array<string|int, mixed>|float|string —The arctangent of the number If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
atan2()
ATAN2.
public
static atan2(mixed $xCoordinate, mixed $yCoordinate) : array<string|int, mixed>|float|string
This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y ÷ x, except that the signs of both arguments are used to determine the quadrant of the result. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between -pi and pi, excluding -pi.
Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.
Excel Function: ATAN2(xCoordinate,yCoordinate)
Parameters
- $xCoordinate : mixed
-
should be float, the x-coordinate of the point, or can be an array of numbers
- $yCoordinate : mixed
-
should be float, the y-coordinate of the point, or can be an array of numbers
Return values
array<string|int, mixed>|float|string —The inverse tangent of the specified x- and y-coordinates, or a string containing an error If an array of numbers is passed as one of the arguments, then the returned result will also be an array with the same dimensions
atanh()
ATANH.
public
static atanh(array<string|int, mixed>|float $number) : array<string|int, mixed>|float|string
Returns the inverse hyperbolic tangent of a number.
Parameters
- $number : array<string|int, mixed>|float
-
Number, or can be an array of numbers
Return values
array<string|int, mixed>|float|string —The inverse hyperbolic tangent of the number If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
tan()
TAN.
public
static tan(mixed $angle) : array<string|int, mixed>|float|string
Returns the result of builtin function tan after validating args.
Parameters
- $angle : mixed
-
Should be numeric, or can be an array of numbers
Return values
array<string|int, mixed>|float|string —tangent If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
tanh()
TANH.
public
static tanh(mixed $angle) : array<string|int, mixed>|float|string
Returns the result of builtin function sinh after validating args.
Parameters
- $angle : mixed
-
Should be numeric, or can be an array of numbers
Return values
array<string|int, mixed>|float|string —hyperbolic tangent If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
evaluateArrayArguments()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
protected
static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>
Example use for: ROUND() or DATE().
Parameters
- $method : callable
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsIgnore()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
protected
static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>
Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.
Parameters
- $method : callable
- $ignore : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubset()
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
protected
static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>
Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.
Parameters
- $method : callable
- $limit : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubsetFrom()
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
protected
static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>
Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.
Parameters
- $method : callable
- $start : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateSingleArgumentArray()
Handles array argument processing when the function accepts a single argument that can be an array argument.
protected
static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>
Example use for: DAYOFMONTH() or FACT().
Parameters
- $method : callable
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>initialiseHelper()
private
static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
- $arguments : array<string|int, mixed>|false
-
Can be changed to array for Php8.1+
testFalse()
private
static testFalse(mixed $value) : bool
Parameters
- $value : mixed