cartesianToPolar.php
Table of Contents
Functions
- cartesianToPolar() : array{angle: float, radius: float}
- Converts a cartesian vector to polar coordinates.
Functions
cartesianToPolar()
Converts a cartesian vector to polar coordinates.
cartesianToPolar(array{x?: float|int, y?: float|int} $vector[, bool $degrees = true ][, bool $throwable = false ]) : array{angle: float, radius: float}
Parameters
- $vector : array{x?: float|int, y?: float|int}
-
Cartesian coordinates with keys 'x' and 'y'.
- $degrees : bool = true
-
Whether the returned angle should be in degrees (default: true).
- $throwable : bool = false
-
Whether to throw an exception if keys are missing (default: false).
Tags
Return values
array{angle: float, radius: float} —Polar coordinates with keys 'angle' and 'radius'.