Question for Trig Gurus
|
07-29-2022, 03:19 PM
(This post was last modified: 07-29-2022 03:56 PM by Albert Chan.)
Post: #22
|
|||
|
|||
RE: Question for Trig Gurus
(12-04-2014 02:36 AM)Gerson W. Barbosa Wrote:(12-02-2014 07:34 PM)Gerson W. Barbosa Wrote: For the range 1/2..1, we use simmetry. It is easy to reduce x, from [1/2 .. sqrt(2)/2], to [0 .. 1/2] cos(2y) = 2*cos(y)^2 - 1 2y = acos(2*cos(y)^2 - 1) = 90° - asin(1 - 2*sin(y)^2) Let y = asin(x): asin(x) = 45° - asin(1-2*x^2)/2 --- We can define asinq(x) = asin(sqrt(x)) This allowed simple transformation, using SOHCAHTOA mnemonic, H=O+A acos(√x) = acosq(x) = asinq(1-x) // O, A, H = 1-x, x, 1 atan(√x) = atanq(x) = asinq(x/(1+x)) // O, A, H = x, 1, 1+x (04-01-2022 05:49 PM)Albert Chan Wrote: Example, following above code steps. acos(0.6) = asinq(1 - 0.36) = pi/2 - asinq(0.36) = pi/2 - (pi/4 - asinq(0.0784)/2) = pi/4 + 1*asinq(0.02) = pi/4 + 2*asinq(0.005025253169416733) = pi/4 + 4*asinq(0.0012578955936787797) = pi/4 + 8*asinq(0.0003145728545004835) = pi/4 + 0.1418970546041639 = 0.9272952180016122 -- or, 53.13010235415598° Comment: code to reduce argument to 1/4 or less can be removed. Code can rely on "half-angle" reduction formula alone (i.e. without using pi) acos(0.6) = 1 * asinq(0.64) = 2 * asinq(0.2) = 4 * asinq(0.05278640450004206) = 8 * asinq(0.013375505266134917) = 16 * asinq(0.003355133235562103) = 32 * asinq(0.0008394880490750656) = 64 * asinq(0.0002099160770281613) = 0.9272952180016122 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)