{
  "id": "polar-coordinates",
  "version": "217cdc1300fc",
  "status": "published",
  "name": "Polar Coordinates Calculator",
  "question": "What are the polar coordinates?",
  "summary": "Converts a point between rectangular coordinates (x, y) and polar coordinates (r, θ), with θ in degrees and radians, and draws the point.",
  "category": "math",
  "subcategory": "trigonometry",
  "url": "https://www.acalculator.org/math/polar-coordinates-calculator",
  "markdown": "https://www.acalculator.org/math/polar-coordinates-calculator.md",
  "kind": "function",
  "method": "Rectangular to polar: r = √(x² + y²), θ = atan2(y, x), plus 360° when negative. Polar to rectangular: x = r cos θ, y = r sin θ.",
  "assumptions": [
    "θ is measured counterclockwise from the positive x-axis. The page gives θ from 0° up to 360°; adding or taking away any whole number of turns (360° or 2π) names the same point.",
    "A typed r may be negative: the point is then on the opposite side of the origin, as in OpenStax."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "to": {
        "title": "Convert",
        "description": "Which way to convert: from (x, y) to (r, θ), or from (r, θ) to (x, y).",
        "type": "string",
        "enum": [
          "toPolar",
          "toRect"
        ]
      },
      "x": {
        "title": "x",
        "description": "The horizontal coordinate of the point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "y": {
        "title": "y",
        "description": "The vertical coordinate of the point.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "r": {
        "title": "r",
        "description": "The distance from the origin; a negative r points the opposite way.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "t": {
        "title": "θ",
        "description": "The angle from the positive x-axis, counterclockwise.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "u": {
        "title": "Angle unit",
        "description": "Whether the angle θ you type is in degrees or radians.",
        "type": "string",
        "enum": [
          "deg",
          "rad"
        ]
      }
    }
  },
  "outputs": {
    "point": {
      "label": "Converted point",
      "description": "The point in the other form, each number to 10 significant figures.",
      "format": "text"
    },
    "x": {
      "label": "x",
      "description": "The horizontal coordinate, r cos θ.",
      "format": "number"
    },
    "y": {
      "label": "y",
      "description": "The vertical coordinate, r sin θ.",
      "format": "number"
    },
    "r": {
      "label": "r",
      "description": "The distance from the origin, √(x² + y²).",
      "format": "number"
    },
    "degrees": {
      "label": "θ in degrees",
      "description": "The angle from the positive x-axis, from 0° up to (not including) 360°.",
      "format": "number"
    },
    "radians": {
      "label": "θ in radians",
      "description": "The same angle in radians, from 0 up to (not including) 2π.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "to": "toPolar",
      "x": 3,
      "y": 3,
      "r": 3,
      "t": 90,
      "u": "deg"
    },
    "outputs": {
      "point": "(r, θ) = (4.242640687, 45°)",
      "x": 3,
      "y": 3,
      "r": 4.242640687119286,
      "degrees": 45,
      "radians": 0.7853981633974483
    },
    "text": "The point converts to (r, θ) = (4.242640687, 45°)."
  },
  "examples": [
    {
      "given": {
        "to": "toPolar",
        "x": 3,
        "y": 3
      },
      "expect": {
        "r": 4.242640687119285,
        "degrees": 45,
        "radians": 0.7853981633974483,
        "point": "(r, θ) = (4.242640687, 45°)"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates (Example 5: r = 3√2, θ = π/4)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "to": "toRect",
        "r": 3,
        "t": 90,
        "u": "deg"
      },
      "expect": {
        "x": 0,
        "y": 3,
        "point": "(x, y) = (0, 3)"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates (Example 3: (3, π/2) is (0, 3))"
    },
    {
      "given": {
        "to": "toRect",
        "r": -2,
        "t": 0,
        "u": "rad"
      },
      "expect": {
        "x": -2,
        "y": 0
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates (Example 4: (−2, 0) is (−2, 0))"
    },
    {
      "given": {
        "to": "toPolar",
        "x": -1,
        "y": -1.7320508075688772
      },
      "expect": {
        "r": 2,
        "degrees": 240,
        "radians": 4.1887902047863905
      },
      "source": "hand calculation in content.mdx: r = √(1 + 3) = 2, atan2(−√3, −1) = −120°, + 360° = 240°; OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates",
      "tolerance": 1e-12
    },
    {
      "given": {
        "to": "toRect",
        "r": 2,
        "t": 30,
        "u": "deg"
      },
      "expect": {
        "x": 1.7320508075688772,
        "y": 1
      },
      "source": "hand calculation in content.mdx: x = 2 cos 30° = √3, y = 2 sin 30° = 1; OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §10.3 Polar Coordinates: x = r cos θ, y = r sin θ, r² = x² + y², tan θ = y/x; Examples 3 to 5. https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-3-polar-coordinates (retrieved 2026-10-02)"
  ],
  "related": [
    "distance-formula",
    "trigonometry",
    "vector",
    "angle"
  ],
  "changelog": []
}
