{
  "id": "speed",
  "version": "dad0ab85947d",
  "status": "published",
  "name": "Speed Calculator",
  "question": "What is the average speed?",
  "summary": "Computes average speed from distance and time, or the distance covered or the time taken from the other two, in any units.",
  "category": "physics",
  "subcategory": "mechanics",
  "url": "https://www.acalculator.org/physics/speed-calculator",
  "markdown": "https://www.acalculator.org/physics/speed-calculator.md",
  "kind": "formulas",
  "method": "speed = distance ÷ time; distance = speed × time; time = distance ÷ speed.",
  "assumptions": [
    "The speed is the average over the whole trip. It says nothing about the speed at any one moment.",
    "Units are converted exactly: 1 mi = 1,609.344 m, 1 ft = 0.3048 m, 1 nautical mile = 1,852 m (NIST SP 811)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "d": {
        "title": "Distance",
        "description": "The distance travelled.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0
      },
      "t": {
        "title": "Time",
        "description": "The time taken to cover the distance.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "time",
        "exclusiveMinimum": 0
      },
      "s": {
        "title": "Average speed",
        "description": "The average speed: distance divided by time.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "speed",
        "exclusiveMinimum": 0
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "d",
      "t",
      "s"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "distance": {
      "label": "Distance",
      "description": "The distance travelled.",
      "format": "quantity"
    },
    "time": {
      "label": "Time",
      "description": "The time taken to cover the distance.",
      "format": "quantity"
    },
    "speed": {
      "label": "Average speed",
      "description": "The average speed: distance divided by time.",
      "format": "quantity",
      "unit": "mph"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "d": 241401.6,
      "t": 9000
    },
    "outputs": {
      "speed": 26.822400000000002
    },
    "text": "Covering 150 mi in 2.5 h is an average speed of 60 mph."
  },
  "examples": [
    {
      "given": {
        "d": 241401.6,
        "t": 9000
      },
      "expect": {
        "s": 26.8224
      },
      "source": "hand calculation in content.mdx: 150 mi ÷ 2.5 h = 60 mph = 60 × 1,609.344 m ÷ 3,600 s = 26.8224 m/s (NIST SP 811: 1 mi = 1,609.344 m)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "s": 27.77777777777778,
        "t": 2700
      },
      "expect": {
        "d": 75000
      },
      "source": "hand calculation in content.mdx: 100 km/h × 0.75 h = 75 km",
      "tolerance": 1e-12
    },
    {
      "given": {
        "d": 42195,
        "s": 5
      },
      "expect": {
        "t": 8439
      },
      "source": "hand calculation in content.mdx: 42,195 m ÷ 5 m/s = 8,439 s = 2 h 20 min 39 s",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "NIST Special Publication 811 (2008), Guide for the Use of the International System of Units, Appendix B.8: 1 mi = 1,609.344 m, 1 ft = 0.3048 m, 1 nautical mile = 1,852 m, 1 h = 3,600 s. https://www.nist.gov/pml/special-publication-811",
    "World Athletics, Competition Rules, Rule 55 (road races): the marathon is 42.195 km. https://worldathletics.org/about-iaaf/documents/book-of-rules"
  ],
  "related": [
    "pace",
    "gear-ratio"
  ],
  "changelog": []
}
