Find Point On Circle

Description: Finds a given point on a circle provided the center of the circle, its radius and the angle. Great for projects such as pie charts or labeling circles.
Tested Platform: All modern browsers
Language: Javascript
// Given the origin point of the circle, its radius and the angle in Radians (degrees * Math.PI / 180)
// it returns the a point object showing the x,y coordinates of the point on a circle.

function findPointOnCircle(originX, originY , radius, angleRadians) {
    let newX = radius * Math.cos(angleRadians) + originX
    let newY = radius * Math.sin(angleRadians) + originY

    return {"x" : newX, "y" : newY}

Posted: March 20, 2023

Return to the snippets listing