Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asin (sin-1) incorrect calculation , look_at on Spatial/InstanceMesh not working too #47023

Closed
sunnydrake opened this issue Mar 15, 2021 · 2 comments · Fixed by #47032
Closed

Comments

@sunnydrake
Copy link

Godot 3.2.3 official from steam
Win10 x64 NVIDIA RTX 2070 GLES2:
*asin(1.571) calculation provide result 1.#QO expected 177.95 :

run code
var center=Vector2(0,0)
var dd=Vector2(0,5)
var dp=Vector2(-0.313,-8.746)
var disdd=center.distance_to(dd) #5
var disdp=center.distance_to(dp) #8.751
var disdddpdiff=dd.distance_to(dp) #13.749
var div=disdddpdiff/disdp #1.571
var angle=asin(div) .#QO expected 177.95
print(angle)

Screenshots attached
image
image

@jmb462
Copy link
Contributor

jmb462 commented Mar 15, 2021

asin() parameter must be between -1 and 1 and the return value is in radian (between -PI/2 and PI/2) not in degrees.

@sunnydrake
Copy link
Author

Sorry yes my bad value must be in range . I was thinking it related to look_at have no visible effect in my script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants