|
inv(x)=tan(x)-x & x: C- r6 V9 y' N1 \ n6 Z/ m- h, I逆函數可以 用表查 , 或是用牛頓法 " Y7 E) O* [% ]. L/ J1 @- O; H! K7 u$ C- E0 R* j1 ? [vb6/vba] Office excel also with this moudle. ?: k. J0 ^( h0 O Public Function Inverse_inv(value As Variant) & V; B6 h" R3 D' Q* SDim ape As Double ! H4 `: Y1 f! _. q rDim pe0 As Double 1 c0 v+ i& G: S' n0 a0 vDim pe1 As Double ( O; U7 A( H4 A/ t, @ e0 r% g6 @* Uape = (3 * value) ^ (1 / 3)' {8 `! `( F$ Y3 m Do8 V% p% h* l. q! P# W2 B If ape >= 1000000000# Then ape = PI / 2: Exit Do" U, L- S# d3 i5 y9 P pe0 = ape " d, [- b8 E6 D) ]. Vpe1 = ape + (value + ape - Tan(ape)) / (Tan(ape) ^ 2)/ o0 O" @+ w" Q, W2 v6 s: c ape = pe1) ^* ~* F. {2 G4 e/ } Loop Until Abs(pe1 - pe0) <= 0.0000001 4 g# N, b! E. g1 e, WInverse_inv = ape' h7 p' `* g5 e End Function |
|