# Inclined Plane & Friction API
> Inclined-plane and friction statics and dynamics as an API, computed locally and deterministically. The incline endpoint analyses a block on a ramp: from a mass, the slope angle and a coefficient of friction it returns the normal force N = m·g·cosθ, the gravity component along the slope m·g·sinθ, the maximum static friction μ·N, whether the block stays put or slides (it slides when tanθ > μ) and, if it slides, the net force and the acceleration a = g·(sinθ − μ·cosθ). The friction endpoint handles a flat surface: the friction force f = μ·N (the normal force given directly or from a mass), the angle of repose atan(μ), and — given an applied force — whether the object moves and its acceleration. The ramp endpoint gives the force needed to move a load up or down a ramp at constant velocity, F = m·g·(sinθ ± μ·cosθ), the frictionless force, the efficiency and whether the ramp is self-locking. Gravity defaults to 9.80665 m/s² and can be overridden. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and mechanics-education tools, materials-handling, conveyor and ramp design, and engineering-statics apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is inclined-plane forces with friction; for the ideal (frictionless) mechanical advantage of simple machines use a lever API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/incline-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 30,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 20 req/s
- **Mega** ($75/Mo) — 750,000 calls/Mo, 50 req/s

## Endpoints

### Mechanics

#### `GET /v1/friction` — Flat-surface friction

**Parameters:**
- `friction` (query, required, string) — Coefficient of friction μ Example: `0.4`
- `mass` (query, optional, string) — Mass (kg) for the normal force Example: `5`
- `normal_force` (query, optional, string) — Or normal force (N)
- `applied_force` (query, optional, string) — Applied horizontal force (N)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/incline-api/v1/friction?friction=0.4&mass=5"
```

**Response:**
```json
{
    "data": {
        "formula": "f = μ·N; angle of repose = atan(μ).",
        "mass_kg": 5,
        "normal_force_n": 49.03325,
        "friction_force_n": 19.6133,
        "angle_of_repose_deg": 21.801409,
        "friction_coefficient": 0.4
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:44.011Z",
        "request_id": "d4359e00-cc09-4688-bfbd-50bd4e47960f"
    },
    "status": "ok",
    "message": "Flat-surface friction",
    "success": true
}
```

#### `GET /v1/incline` — Block on an inclined plane

**Parameters:**
- `mass` (query, required, string) — Mass (kg) Example: `10`
- `angle` (query, required, string) — Slope angle (degrees) Example: `30`
- `friction` (query, optional, string) — Coefficient of friction μ (default 0) Example: `0.3`
- `gravity` (query, optional, string) — Gravity (default 9.80665)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/incline-api/v1/incline?mass=10&angle=30&friction=0.3"
```

**Response:**
```json
{
    "data": {
        "slides": true,
        "formula": "N = m·g·cosθ; slope force = m·g·sinθ; slides when m·g·sinθ > μ·N.",
        "mass_kg": 10,
        "weight_n": 98.0665,
        "angle_deg": 30,
        "gravity_ms2": 9.80665,
        "net_force_n": 23.554826,
        "normal_force_n": 84.92808,
        "acceleration_ms2": 2.355483,
        "friction_coefficient": 0.3,
        "gravity_along_slope_n": 49.03325,
        "max_static_friction_n": 25.478424
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:44.112Z",
        "request_id": "af88cdd5-cb40-458d-8ee4-0dc716616486"
    },
    "status": "ok",
    "message": "Block on an inclined plane",
    "success": true
}
```

#### `GET /v1/ramp` — Force to move a load on a ramp

**Parameters:**
- `mass` (query, required, string) — Mass (kg) Example: `10`
- `angle` (query, required, string) — Ramp angle (degrees) Example: `30`
- `friction` (query, optional, string) — Coefficient of friction μ (default 0) Example: `0.3`
- `gravity` (query, optional, string) — Gravity (default 9.80665)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/incline-api/v1/ramp?mass=10&angle=30&friction=0.3"
```

**Response:**
```json
{
    "data": {
        "note": "A positive force is needed even to ease the load down.",
        "formula": "F_up = m·g·(sinθ + μ·cosθ); F_down = m·g·(sinθ − μ·cosθ).",
        "mass_kg": 10,
        "weight_n": 98.0665,
        "angle_deg": 30,
        "efficiency": 0.658061,
        "self_locking": false,
        "friction_coefficient": 0.3,
        "frictionless_force_n": 49.03325,
        "force_up_constant_velocity_n": 74.511674,
        "force_down_constant_velocity_n": 23.554826
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:44.222Z",
        "request_id": "ed397b1c-6783-437e-854c-51b95484585f"
    },
    "status": "ok",
    "message": "Force to move a load up/down a ramp",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/incline-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "api": "incline",
        "note": "Inclined-plane & friction statics/dynamics — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/incline",
            "/v1/friction",
            "/v1/ramp",
            "/v1/meta"
        ],
        "gravity_default_ms2": 9.80665
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:44.342Z",
        "request_id": "84a8a01c-14c9-4755-86fb-d7a4d42e36f2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/incline-api
OpenAPI spec: https://www.oanor.com/api/incline-api/openapi.json
