Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should take a look at the documentation of
atan2(here).What you’re looking of is finding the difference between B (your upper left vector) and A (your bottom right vector), then pass this as a parameter to
atan2What your code currently does is find the angle of the vector
bin reference to0,0and subtract the angle of the vectorain reference to0,0.The reason you always get 0 is because
1,1and50,50are on the same line that crosses0,0(both calls return something approx.0.785398), so subtracting them will result in0