UNPKG

@technobuddha/library

Version:
16 lines (15 loc) 537 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toCartesian = void 0; /** * Convert polar coordinates to cartesian * @param radius Radius. * @param angle Angle in radians (zero points in +X direction). * @returns Object containing the X and Y-distance for the angle and radius. */ function toCartesian(_a) { var radius = _a.radius, angle = _a.angle; return { x: radius * Math.cos(angle), y: radius * Math.sin(angle) }; } exports.toCartesian = toCartesian; exports.default = toCartesian;