LoginSignup
0
0

More than 5 years have passed since last update.

MATLAB: acos(44) > 0.0000 + 4.4772i | Numpy: np.arccos(44) > nan

Last updated at Posted at 2017-11-21
動作環境
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04 LTS desktop amd64
TensorFlow v1.2.1
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
scipy v0.19.1
geopandas v0.3.0
MATLAB R2017b (Home Edition)

MATLAB

>> acos(44)

ans =

   0.0000 + 4.4772i

For real values of x outside the interval [-1,1] and for complex values of x, acos(x) returns complex values. All angles are in radians.

[-1, 1]の外の値なので、複素数を返す。
この複素数の計算が不明。

Numpy

import numpy as np

res = np.arccos(44)
print(res)
run
nan

Numpyの場合はnanを返す。

TODO

[ ] MATLABでのacos()の複素数値の意味

自分が扱う問題では[-1, 1]の範囲内になりそうなので調査は保留とする。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0