What is the “correct” algorithm to calculate the angle in degrees from a WPF Line?
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 need
atan2. This would however give you the angle in radians, converting to degrees must be easy 🙂 The angle is calculated asatan2(y2 - y1, x2 - x1), where(x1, y1)and(x2, y2)are your line ends.Note that the constant
piis available, too.