MCPcopy Create free account
hub / github.com/ampproject/amphtml / polarToCartesian

Function polarToCartesian

src/core/math.js:132–139  ·  view source on GitHub ↗
(centerX, centerY, radius, angleInDegrees)

Source from the content-addressed store, hash-verified

130 * }}
131 */
132export function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
133 const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
134
135 return {
136 x: centerX + radius * Math.cos(angleInRadians),
137 y: centerY + radius * Math.sin(angleInRadians),
138 };
139}
140
141/**
142 * Sums up the values of the given array and returns the result

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected