Post Reply 
[VA] SRC #009 - Pi Day 2021 Special
03-15-2021, 11:06 PM (This post was last modified: 03-17-2021 02:10 AM by Albert Chan.)
Post: #5
RE: [VA] SRC #009 - Pi Day 2021 Special
(03-15-2021 09:33 PM)Gerson W. Barbosa Wrote:  For constants less than -1 divide the result by -3.

The reason for this is because atan(x) only return principle angle, between ±pi/2
Let the constant is x, instead of e:

atan((x-1)/(x+1)) = atan((x - tan(pi/4)) / (1 + tan(pi/4)*x) = atan(tan(atan(x) - pi/4))

If atan(x) - pi/4 ≥ -pi/2 (equivalent to x ≥ -1 x > -1): (*)

4*(atan(x) - atan((x-1)/(x+1)) = 4*(atan(x) - (atan(x) - pi/4)) = pi

If atan(x) - pi/4 < -pi/2 (equivalent to x < -1):

4*(atan(x) - atan((x-1)/(x+1)) = 4*(atan(x) - (atan(x) - pi/4 + pi)) = -3*pi


(*) Correction: At x=-1, atan((x-1)/(x+1)) = atan(±∞) is undefined.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #009 - Pi Day 2021 Special - Albert Chan - 03-15-2021 11:06 PM



User(s) browsing this thread: 1 Guest(s)