英語版
このページの英語版を見る
std.math.trigonometry
これは std.math.
いくつかの三角関数を含んでいる。
License:
Authors:
Walter Bright, Don Clugston,
Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger
- pure nothrow @nogc @safe real
cos
(realx
);
pure nothrow @nogc @safe doublecos
(doublex
);
pure nothrow @nogc @safe floatcos
(floatx
); - x の余弦を返す。
特殊値 x cos(x) 無効か? 無効 無効 はい ±∞ 無効 はい Bugs:x| >=264 の場合、結果は未定義となる。Examples:import std.math.operations : isClose; writeln(cos(0.0)); // 1.0 assert(cos(1.0).isClose(0.5403023059)); assert(cos(3.0).isClose(-0.9899924966));
- pure nothrow @nogc @safe real
sin
(realx
);
pure nothrow @nogc @safe doublesin
(doublex
);
pure nothrow @nogc @safe floatsin
(floatx
); 特殊値 x sin(x) 無効か? 無効 無効 はい ±0.0 ±0.0 なし ±∞ ナン あり Parameters:real x
ラジアン単位の角度(度ではない) Returns:xの正弦Bugs:x| >=264の場合、結果は未定義となる。Examples:import std.math.constants : PI; import std.stdio : writefln; void someFunc() { real x = 30.0; auto result = sin(x * (PI / 180)); // 度数をラジアンに変換する writefln("The sine of %s degrees is %s", x, result); }
- pure nothrow @nogc @safe real
tan
(realx
);
pure nothrow @nogc @safe doubletan
(doublex
);
pure nothrow @nogc @safe floattan
(floatx
); - x はラジアン単位である。
特殊な値 x tan(x) 無効か? NAN 無効 はい ±0.0 ±0.0 なし ±∞ ナン あり Examples:import std.math.operations : isClose; import std.math.traits : isIdentical; import std.math.constants : PI; import std.math.algebraic : sqrt; assert(isIdentical(tan(0.0), 0.0)); assert(tan(PI).isClose(0, 0.0, 1e-10)); assert(tan(PI / 3).isClose(sqrt(3.0)));
- pure nothrow @nogc @safe real
acos
(realx
);
pure nothrow @nogc @safe doubleacos
(doublex
);
pure nothrow @nogc @safe floatacos
(floatx
); - xのアークコサインを計算する、 0からπまでの値を返す。
特殊な値 x acos(x) 無効か? >1.0 NAN はい <-1.0 無効 はい NAN なし はい Examples:import std.math.operations : isClose; import std.math.traits : isNaN; import std.math.constants : PI; assert(acos(0.0).isClose(1.570796327)); assert(acos(0.5).isClose(PI / 3)); assert(acos(PI).isNaN);
- pure nothrow @nogc @safe real
asin
(realx
);
pure nothrow @nogc @safe doubleasin
(doublex
);
pure nothrow @nogc @safe floatasin
(floatx
); - xのアークサインを計算する、 π/2からπ/2の範囲の値を返す。
特殊な値 x asin(x) 無効か? ±0.0 ±0.0 いいえ >1.0 無効 あり <-1.0 なし はい Examples:import std.math.operations : isClose; import std.math.traits : isIdentical, isNaN; import std.math.constants : PI; assert(isIdentical(asin(0.0), 0.0)); assert(asin(0.5).isClose(PI / 6)); assert(asin(PI).isNaN);
- pure nothrow @nogc @safe real
atan
(realx
);
pure nothrow @nogc @safe doubleatan
(doublex
);
pure nothrow @nogc @safe floatatan
(floatx
); - xのアークタンジェントを計算する、 π/2からπ/2の範囲の値を返す。
特別な値 x atan(x) 無効か? ±0.0 ±0.0 無効 ±∞ 無効 あり Examples:import std.math.operations : isClose; import std.math.traits : isIdentical; import std.math.constants : PI; import std.math.algebraic : sqrt; assert(isIdentical(atan(0.0), 0.0)); assert(atan(sqrt(3.0)).isClose(PI / 3));
- pure nothrow @nogc @trusted real
atan2
(realy
, realx
);
pure nothrow @nogc @safe doubleatan2
(doubley
, doublex
);
pure nothrow @nogc @safe floatatan2
(floaty
, floatx
); - y / x のアークタンジェントを計算する、 πからπまでの値を返す。
特別な値 y x atan(y, x) ナン 何でも ナン 何でも ナン NAN ±0.0 >0.0 ±0.0 ±0.0 +0.0 ±0.0 ±0.0 <0.0 ±π ±0.0 -0.0 ±π >0.0 ±0.0 π/2 <0.0 ±0.0 -π/2 >0.0 ∞ ±0.0 ±∞ 何でも ±π/2 >0.0 -∞ ±π ±∞ ∞ ±π/4 ±∞ -∞ ±3π/4 Examples:import std.math.operations : isClose; import std.math.constants : PI; import std.math.algebraic : sqrt; assert(atan2(1.0, sqrt(3.0)).isClose(PI / 6));
- pure nothrow @nogc @safe real
cosh
(realx
);
pure nothrow @nogc @safe doublecosh
(doublex
);
pure nothrow @nogc @safe floatcosh
(floatx
); - xの双曲余弦を計算する。
特別な値 x cosh(x) 無効か? ±∞ ±0.0 無効 Examples:import std.math.constants : E; import std.math.operations : isClose; writeln(cosh(0.0)); // 1.0 assert(cosh(1.0).isClose((E + 1.0 / E) / 2));
- pure nothrow @nogc @safe real
sinh
(realx
);
pure nothrow @nogc @safe doublesinh
(doublex
);
pure nothrow @nogc @safe floatsinh
(floatx
); - xの双曲線正弦を計算する。
特別な値 x sinh(x) 無効か? ±0.0 ±0.0 無効か? ±∞ ±∞ no Examples:import std.math.constants : E; import std.math.operations : isClose; import std.math.traits : isIdentical; enum sinh1 = (E - 1.0 / E) / 2; import std.meta : AliasSeq; static foreach (F; AliasSeq!(float, double, real)) { assert(isIdentical(sinh(F(0.0)), F(0.0))); assert(sinh(F(1.0)).isClose(F(sinh1))); }
- pure nothrow @nogc @safe real
tanh
(realx
);
pure nothrow @nogc @safe doubletanh
(doublex
);
pure nothrow @nogc @safe floattanh
(floatx
); - xの双曲線正接を計算する。
特別な値 x tanh(x) 無効か? ±0.0 ±0.0 無効か? ±∞ ±1.0 なし Examples:import std.math.operations : isClose; import std.math.traits : isIdentical; assert(isIdentical(tanh(0.0), 0.0)); assert(tanh(1.0).isClose(sinh(1.0) / cosh(1.0)));
- pure nothrow @nogc @safe real
acosh
(realx
);
pure nothrow @nogc @safe doubleacosh
(doublex
);
pure nothrow @nogc @safe floatacosh
(floatx
); - xの逆ハイパーボリックコサインを計算する。数学的には、acosh(x) = log(x + sqrt( x*x - 1)) となる。
範囲 X 範囲 Y 1..∞ 0..∞ 特別な値 x acosh(x) ナン NAN <1 NAN 1 0 +∞ +∞ Examples:import std.math.traits : isIdentical, isNaN; assert(isNaN(acosh(0.9))); assert(isNaN(acosh(real.nan))); assert(isIdentical(acosh(1.0), 0.0)); writeln(acosh(real.infinity)); // real.infinity assert(isNaN(acosh(0.5)));
- pure nothrow @nogc @safe real
asinh
(realx
);
pure nothrow @nogc @safe doubleasinh
(doublex
);
pure nothrow @nogc @safe floatasinh
(floatx
); - xの逆ハイパーボリック正弦を計算する。数学的に
asinh(x) = log( x + sqrt( x*x + 1 )) // if x >= +0 asinh(x) = -log(-x + sqrt( x*x + 1 )) // if x <= -0
特別な値 x asinh(x) NAN NAN ±0 ±0 ±∞ ±∞ Examples:import std.math.traits : isIdentical, isNaN; assert(isIdentical(asinh(0.0), 0.0)); assert(isIdentical(asinh(-0.0), -0.0)); writeln(asinh(real.infinity)); // real.infinity writeln(asinh(-real.infinity)); // -real.infinity assert(isNaN(asinh(real.nan)));
- pure nothrow @nogc @safe real
atanh
(realx
);
pure nothrow @nogc @safe doubleatanh
(doublex
);
pure nothrow @nogc @safe floatatanh
(floatx
); - xの逆双曲線上の正接を計算する、 から1までの値を返す。数学的には、atanh(x) = log( (1+x)/(1-x) ) となる。/ 2
範囲 X 範囲 Y -∞..∞ -1 .. 1
特別な値 x acosh(x) ナン NAN ±0 ±0 -∞ -0 Examples:import std.math.traits : isIdentical, isNaN; assert(isIdentical(atanh(0.0), 0.0)); assert(isIdentical(atanh(-0.0),-0.0)); assert(isNaN(atanh(real.nan))); assert(isNaN(atanh(-real.infinity))); writeln(atanh(0.0)); // 0
Copyright © 1999-2024 by the D Language Foundation
DEEPL APIにより翻訳、ところどころ修正。
このページの最新版(英語)
このページの原文(英語)
翻訳時のdmdのバージョン: 2.108.0
ドキュメントのdmdのバージョン: 2.109.1
翻訳日付 :
HTML生成日時:
編集者: dokutoku