# Angle normalize

`angle-normalize` · version 1.0.0 · Numbers & math · free, no key needed

Wraps an angle into an unsigned or signed one-turn range and returns the whole turns removed.

**Use when you need to: normalize angle to 0 360 · wrap degrees between 0 and 360 · normalize radians to minus pi plus pi.**

## Decide before calling

Read the [versioned contract](/v1/tools/angle-normalize/versions/1.0.0) and the supported scope below. Reuse `angle-normalize@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `angle-normalize@1.0.0` for normalize angle to 0 360. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- normalize angle to 0 360
- wrap degrees between 0 and 360
- normalize radians to minus pi plus pi
- remove full turns from angle
- canonicalize a compass heading
- wrap gon into one turn
- normalize negative angle

## Not supported

- calculate trigonometric functions
- unwrap a time series of angles

## Behavior

- zero_to_full returns [0, one turn); negative_half_to_positive_half returns (-half turn, positive half turn], in the selected unit.
- turns_removed is the signed integer k used before rounding, adjusted after rounding: subtract one full turn and increment k above the signed upper boundary or at/above the unsigned upper boundary; add one full turn and decrement k at/below the signed lower boundary or below zero in the unsigned range.
- Radian boundaries use the same fixed pi digits as angle-unit-convert. Apply the requested rounding mode once; after any full-turn range correction, truncate an off-grid radian value toward zero onto the requested decimal grid, preserving the interval.
- Rounding modes are half_even, half_up, toward_zero, floor, and ceiling; trailing fractional zeroes are removed.
- Returns standard_version on every success.
- The decimal_places request consumes one bounded output-grid iteration per place (maximum 60); the input has exactly five logical items, and the serialized result is checked against the 325-byte output cap.
- Decimal strings use plain base-10 notation; finite JSON numbers use their canonical decimal coefficient and exponent. Values have at most 100 coefficient digits and at most 60 fractional coefficient digits; longer fractions are rejected as invalid_input.

## Input

- `value` (string or number, required)
- `unit` (one of "degrees", "radians", "gradians", "turns", "arcminutes", "arcseconds", required)
- `range` (one of "zero_to_full", "negative_half_to_positive_half", required)
- `decimal_places` (number, required): min 0; max 60
- `rounding_mode` (one of "half_even", "half_up", "toward_zero", "floor", "ceiling", required)

## Output

- `standard_version` (string, required)
- `value` (string, required)
- `exact` (boolean, required)
- `rounded` (boolean, required)
- `decimal_places` (number, required): min 0; max 60
- `rounding_mode` (one of "half_even", "half_up", "toward_zero", "floor", "ceiling", required)
- `unit` (one of "degrees", "radians", "gradians", "turns", "arcminutes", "arcseconds", required)
- `range` (one of "zero_to_full", "negative_half_to_positive_half", required)
- `turns_removed` (string, required)

## Limits

- max input bytes: 203
- max value bytes: 128
- max digits: 100
- max decimal places: 60
- max items: 5
- max iterations: 60
- max output bytes: 325

## Example

Request input:

```json
{
  "value": "-30",
  "unit": "degrees",
  "range": "zero_to_full",
  "decimal_places": 2,
  "rounding_mode": "half_even"
}
```

Response:

```json
{
  "result": {
    "value": "330",
    "exact": true,
    "rounded": false,
    "unit": "degrees",
    "range": "zero_to_full",
    "turns_removed": "-1",
    "decimal_places": 2,
    "rounding_mode": "half_even",
    "standard_version": "SI Brochure 9th ed. (2019), Table 4; ISO 80000-3:2019"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "angle-normalize",
  "version": "1.0.0",
  "input": {
    "value": "-30",
    "unit": "degrees",
    "range": "zero_to_full",
    "decimal_places": 2,
    "rounding_mode": "half_even"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/angle-normalize/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"-30","unit":"degrees","range":"zero_to_full","decimal_places":2,"rounding_mode":"half_even"}'
```

The machine-readable contract is at [/v1/tools/angle-normalize/versions/1.0.0](/v1/tools/angle-normalize/versions/1.0.0).

### CLI

```sh
node cli.mjs run angle-normalize 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Angle unit convert](/tools/angle-unit-convert): Converts an angle between six units and returns a decimal value plus exact-or-rounded status.
- [Roman numeral convert](/tools/roman-numeral-convert): Convert integers 1–3999 to canonical Roman numerals and strictly parse canonical numerals back to integers.
- [Classification metrics compute](/tools/classification-metrics-compute): Compute exact binary-classification metrics from integer confusion-matrix counts as reduced fractions or null.
- [Integer expression evaluate](/tools/integer-expression-evaluate): Evaluate exact integer arithmetic and return decimal, hexadecimal, and binary results.
- [Lp dual feasibility check](/tools/lp-dual-feasibility-check): Check that LP dual multipliers satisfy y >= 0 and yA >= c exactly; return the proven upper bound y.b.
- [Correlation kendall tau](/tools/correlation-kendall-tau): Compute Kendall tau-b correlation with tie correction and return a precision-rounded decimal coefficient.
