The problem is this only works using degree calculations, which Godot does radian by standard. So I was wondering if there is a better way to do this with Godot, or at least how to make Godot calculate in degrees not radians.

Note: If you’re generating random points on a circle, you may want to support this proposal.

You can easily convert between degrees and radians at will via the following 2 utility functions:

var rads = deg2rad(deg)
var degs = rad2deg(rad)

Yeah I tried that, but where would I put the rad2deg() in the equation

offset + r*cos(θ)

Because on a calculator in degrees mode, 0+1cos(30) = 0.8660254038
But on Godot, rad2deg(0+1cos(30)) = 8.837957

Thank you in advance

stevepetoskey | 2020-11-10 19:27

Godot’s sin() and cos() functions expect radians. If the value you have is in degrees you’d want to convert that to radians prior to passing it to the cos/sin functions.