不知所云
Tuesday, July 31, 2012
atan2 vs arctan
有時候會看人家寫 arctan(x, y)
可是 arctan 不是只需要一個變數嗎?
其實這是
atan2
函數
如果你想找 (x,y) 點的夾腳,正常方法是先算 y/x 再用那直帶入 arctan 可是同時要考慮 x,y 的符號 ( (1,1) vs (-1,-1) ) ,也要考慮 x是否等於零 (y/0 未定意,要你直接推測角度)
atan2 就只是一個直接用 x,y 算出夾腳的函數 (可以用普通的 arctan 表達),程式常用,因為比較直接,不用管那些細節
No comments :
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments ( Atom )
No comments :
Post a Comment