/v1/power
Power & roots
Δοκιμάστε το ζωντανά
10 δωρεάν κλήσεις την ημέρα — χωρίς εγγραφή, χωρίς κλειδί API. Μέσω του gateway του oanor.
Δουλεύει. Πάρε ένα κλειδί API και χρησιμοποίησέ το στο έργο σου.
Λάβετε ένα κλειδί APIΑποσπάσματα κώδικα
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_..."}
)
Παράδειγμα απόκρισης
Πραγματική απόκριση αυτού του endpoint, από τον τελευταίο έλεγχο υγείας.
{
"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
}