Ir al contenido
GET /v1/power

Power & roots

Pruébalo en vivo

10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.

Encabezados personalizados (opcional)
api.oanor.com/complexnumber-api

Funciona. Consigue una clave API y úsala en tu proyecto.

Obtener una clave API

Fragmentos de código

curl "https://api.oanor.com/complexnumber-api/v1/power" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/complexnumber-api/v1/power", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/complexnumber-api/v1/power");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/complexnumber-api/v1/power",
    headers={"x-oanor-key": "oanor_test_..."}
)

Respuesta de ejemplo

Una respuesta real de este endpoint, capturada en la última comprobación de estado.

{
    "data": {
        "note": "De Moivre: zⁿ = rⁿ·(cos nθ + i·sin nθ). For a positive integer n the n distinct n-th roots are also returned.",
        "power": {
            "real": 512,
            "modulus": 512,
            "imaginary": 0,
            "polar_form": "512 ∠ 0°",
            "rectangular": "512",
            "argument_deg": 0,
            "argument_rad": 0
        },
        "roots": [
            {
                "real": 2,
                "modulus": 2,
                "imaginary": 0,
                "polar_form": "2 ∠ 0°",
                "rectangular": "2",
                "argument_deg": 0,
                "argument_rad": 0
            },
            {
                "real": -1,
                "modulus": 2,
                "imaginary": 1.732050808,
                "polar_form": "2 ∠ 120°",
                "rectangular": "-1 + 1.732051i",
                "argument_deg": 120,
                "argument_rad": 2.094395102
            },
            {
                "real": -1,
                "modulus": 2,
                "imaginary": -1.732050808,
                "polar_form": "2 ∠ -120°",
                "rectangular": "-1 - 1.732051i",
                "argument_deg": -120,
                "argument_rad": -2.094395102
            }
        ],
        "inputs": {
            "n": 3,
            "z": "8"
        },
        "roots_count": 3
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:04.435Z",
        "request_id": "c0fbab7e-2f1f-4dd0-b14d-04860a01e672"
    },
    "status": "ok",
    "message": "Power & roots",
    "success": true
}