java cos値を取得する

javaで、cos値を取得する手順を記述してます。「Math.cos」に計算したい数値を指定することで可能です。
環境
- OS windows11 home
- java 19.0.1
手順
cos値を取得するには、「Math.cos」で可能です。
Math.cos(数値)
実際に、使用してみます。
public class App {
public static void main(String[] args) throws Exception {
System.out.println(Math.cos(Math.PI / 3)); // 0.5000000000000001
System.out.println(Math.cos(Math.PI / 4)); // 0.7071067811865476
}
}
取得されていることが確認できます。
-
前の記事
Google Colaboratory コマンドパレットを開くショートカットキー 2024.04.25
-
次の記事
Oracle Database ユーザーにロールを付与する 2024.04.26
コメントを書く