Math.Sinの読み方

Math.Sinの読み方

C#で利用されるメソッドの1つである「Math.Sin」の読み方を掲載してます。

読み⽅

マス・サイン」と読みます。

英訳

「Math」は「数学」という意味があります。

Math.Sinとは

C#で、角度と斜辺から高さを求めることができるメソッドとなります。

using System;

namespace sebeeapp
{
    class Program
    {
        static void Main(string[] args)
        {

            double angle, hypotenuse, height;

            angle = 60; // 角度
            hypotenuse = 2; // 斜辺

            // 高さを求める
            height = hypotenuse * Math.Sin(Math.PI * angle / 180.0);
            Console.WriteLine(height); // 1.7320508075688772

        }
    }
}