std::atan2
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
Defined in header <cmath>
|
||
float atan2( float y, float x ); |
(1) | |
double atan2( double y, double x ); |
(2) | |
long double atan2( long double y, long double x ); |
(3) | |
Promoted atan2( Arithmetic y, Arithmetic x ); |
(4) | (C++11およびそれ以降) |
正しく象限を決定するための引数の符号を用いて
4) y/x
の逆正接を計算. Original:
Computes the inverse tangent of
y/x
using the signs of arguments to correctly determine quadrant. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
いずれかの引数が整数型を持つ場合、それはdoubleにキャストされます。他の引数はlong doubleあれば、戻り値の型はlong double、それ以外の場合はdoubleです.
Original:
If any argument has integral type, it is cast to double. If any other argument is long double, then the return type is long double, otherwise it is double.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
x, y | - | 浮動小数点値
Original: floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
y/x
ラジアンの範囲のラジアンで表わした[-π; π]
のアークタンジェント.Original:
Arc tangent of
y/x
in radians in the range of [-π; π]
radians.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
このコードを実行します
#include <cmath> #include <utility> #include <iostream> std::pair<double, double> cartesian_to_polar(double x, double y) { return {std::hypot(x, y), std::atan2(y,x)}; } int main() { std::pair<double, double> polar = cartesian_to_polar(1, 1); std::cout << "(1,1) cartesian is (" << polar.first << "," << polar.second<< ") polar\n"; }
出力:
(1,1) cartesian is (1.41421,0.785398) polar
[編集] 参照
アークタンジェント(arctan(x))を計算します Original: computes arc tangent (arctan(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
アークサイン(arcsin(x))を計算します Original: computes arc sine (arcsin(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
アークコサイン(arccos(x))を計算します Original: computes arc cosine (arccos(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
正接(tan(x))を計算します Original: computes tangent (tan(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) |