polarToCartesian
Chart
stable
Convert a polar coordinate (centre, radius, angle in radians) into a Cartesian `[x, y]` point. Uses the mathematical convention — zero at 3 o'clock, counter-clockwise — shifted to noon/clockwise for visual consistency with radar and pie charts.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- cxrequirednumber
- X coordinate of the circle centre in SVG user units.
- cyrequirednumber
- Y coordinate of the circle centre in SVG user units.
- radiusrequirednumber
- Distance from the centre to the point.
- anglerequirednumber
- Angle in radians using the mathematical convention (0 = 3 o'clock, counter-clockwise). Internally shifted by `-π/2` so that 0 = noon, clockwise, matching `arcPath`.
API
Return value
The value returned by this util.
- A `[x, y]` tuple in SVG user units representing the Cartesian equivalent of the given polar coordinate.
Usage
Examples
Ready-to-paste usage snippets.
Position a label at the top of a circle