MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   Mathematica论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=34)
-   -   [问题] 请求帮忙解释一下这一小段程序 (https://www.labfans.com/bbs/showthread.php?t=20698)

allendingjun 2014-10-16 07:16

请求帮忙解释一下这一小段程序
 
要重新定义一个反三角函数(如下):

arcCos[z_, i_] := Block[{x = Re[z], y = Im[z], y0},

If[i == 1, arcCos["s"] = 1; arcCos["n"] = 0,
y0 = Im[arcCos["last arg"]];

If[(Min[y0, y] < 0 <= Max[y0, y] \[And]
x < -1) \[Or] (Min[y0, y] <= 0 < Max[y0, y] \[And] x > 1),
arcCos["n"] +=
arcCos["s"] Round[(ArcCos[z] + ArcCos[arcCos["last arg"]])/(
2 \[Pi])]; arcCos["s"] = -arcCos["s"]]];
arcCos["last arg"] = z;
arcCos["s"] ArcCos[z] + 2 \[Pi] arcCos["n"]
]

请问其中 (1)["last arg"]是什么意思?(2)第一个 if 管到哪里?
如果有谁能详细解释一下这段程序最好了,谢谢~~


所有时间均为北京时间。现在的时间是 12:48

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.