← All tool references

Math · not_available

Complex Number Calculator

Perform arithmetic with two complex numbers.

Open public tool

Overview

Category
Math
API mode
not_available
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/complex-number-calculator

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/complex-number-calculator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

a_real · number · required
Enter first real part.
a_imag · number · required
Enter first imaginary part.
b_real · number · required
Enter second real part.
b_imag · number · required
Enter second imaginary part.
operation · string · required
Enter operation. Accepted values: add, subtract, multiply, divide.
{
    "type": "object",
    "properties": {
        "a_real": {
            "type": "number",
            "description": "Enter first real part."
        },
        "a_imag": {
            "type": "number",
            "description": "Enter first imaginary part."
        },
        "b_real": {
            "type": "number",
            "description": "Enter second real part."
        },
        "b_imag": {
            "type": "number",
            "description": "Enter second imaginary part."
        },
        "operation": {
            "type": "string",
            "description": "Enter operation.",
            "enum": [
                "add",
                "subtract",
                "multiply",
                "divide"
            ]
        }
    },
    "required": [
        "a_real",
        "a_imag",
        "b_real",
        "b_imag",
        "operation"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

result · string
Complex result produced by the tool.
real_part · number
Real part produced by the tool.
imaginary_part · number
Imaginary part produced by the tool.
magnitude · number
Magnitude produced by the tool.
{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "description": "Complex result produced by the tool."
        },
        "real_part": {
            "type": "number",
            "description": "Real part produced by the tool."
        },
        "imaginary_part": {
            "type": "number",
            "description": "Imaginary part produced by the tool."
        },
        "magnitude": {
            "type": "number",
            "description": "Magnitude produced by the tool."
        }
    },
    "additionalProperties": false
}

Complex Number Calculator worked example

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/complex-number-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "a_real": 3,
    "a_imag": 4,
    "b_real": 2,
    "b_imag": -1,
    "operation": "multiply"
}'
{
    "ok": true,
    "data": {
        "slug": "complex-number-calculator",
        "result": {
            "values": {
                "result": "10 + 5i",
                "real_part": 10,
                "imaginary_part": 5,
                "magnitude": 11.1803399999999992786570146563462913036346435546875
            },
            "display": {
                "display": "10 + 5i"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.