• Website: www.manwar.org/
• About: CPAN Author & Contributor. Co-editor of PerlWeekly newsletter. Write article for http://perl.com, Father of 3 angels. Indian by birth, British by choice.
Recent Actions from Mohammad S Anwar

• laurent_r commented on Perl Weekly Challenge 26: Common Letters and Mean Angles

Thank you for your comment, Mohammad, I've fixed the typo on the week number now.

• laurent_r commented on Perl Weekly Challenge 26: Common Letters and Mean Angles

Hi Saif, I have made some tests to check that it still works correctly with the sum values rather than the average values (i.e. without dividing by the two sums corresponding to the input angles by the number of angles). I have now updated the post accordingly. Thank you very much for having pointed out this possible simplification of the code.

• Yet Ebreo commented on Perl Weekly Challenge 26: Common Letters and Mean Angles

Just to add why it works, atan2 is actually arctan of y/x. Same formula for angle of inclination wrt +x and slope of a line.

• laurent_r commented on Perl Weekly Challenge 26: Common Letters and Mean Angles

Yeah, well, I understand what you mean and I mostly agree, Yet, but, strictly speaking, this is true only for x > 0. You have to add or subtract pi when x

• laurent_r commented on Perl Weekly Challenge 26: Common Letters and Mean Angles

Oops, messages are cut off when there is the smaller than symbol in it.

I try again:

Yeah, well, I understand what you mean and I mostly agree, Yet, but, strictly speaking, this is true only for x > 0. You have to add or subtract pi when x is negative, and atan2(y, x) is usually defined for x == 0 (at least for values of y other than 0), even though y/x would lead to an exception when x = 0. I chose to give a geometrical interpretation of atan2 (the rectangular coordinates of a point in the plan) in my update to avoid having to deal with all these edge-case difficulties in al…