Created
March 30, 2015 08:20
-
-
Save BcRikko/4a158a3fa22822ada157 to your computer and use it in GitHub Desktop.
三角関数の使い方
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
// 角度が30°の場合 | |
var angle = 30; | |
var sin = Math.Sin(angle * (Math.PI / 180)); | |
var cos = Math.Cos(angle * (Math.PI / 180)); | |
var tan = Math.Tan(angle * (Math.PI / 180)); | |
//"Sin:0.5, Cos:0.87, Tan:0.58" ※少数第二位で四捨五入 | |
Console.WriteLine("Sin:{0}, Cos:{1}, Tan:{2}", sin, cos, tan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment