How to find a point in an ellipse given the angle

659 Views Asked by At

I found a couple of formulas but I can't transform them in code.

From the answer in Calculating a Point that lies on an Ellipse given an Angle , for instance, I get to:

var x = (a * b) / Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) * Math.pow(Math.tan(angle), 2));
var y = x * Math.tan(angle);

But this doesn't give the result expected.

(wanted to comment on the already created answers but I don't have enough privileges)