Not a spelling mistake or an americanism. Bear in mind that American English is spoken by more people on the planet than our quaint old version. As you would expect, there are lots more of them programming too. Expect lots of these things in programming languages. You can expect the word color to show up later on.
The Math Class has lots of ready-made maths stuff for us to use as well as a couple of useful constants,
Math.E
Math.PI
The table below is a list of most of the methods in the Math class. The Math class is part of the .NET class library. It is the same for all of the languages in the .NET family. In the table, the letters x and y are used to represent the values passed to the function. These are called the parameters of the function call.
Function | Description | Accepts | Returns |
Math.Abs(x) | Absolute value of x (removes sign) | Any numeric data type | The same type |
Math.Acos(x) | Returns the angle whose cosine is the x | Double | Double |
Math.Asin(x) | Returns the angle whose sine is x | Double | Double |
Math.Atan(x) | Returns the angle whose tangent is x | Double | Double |
Math.Ceiling(x) | Rounds x up to the nearest integer | Double/Decimal | Double/Decimal |
Math.Cos(x) | Returns the cosine of x | Double | Double |
Math.Exp(x) | Returns e raised to the power of x | Double | Double |
Math.Floor(x) | Rounds x down to the nearest integer | Double/Decimal | Double/Decimal |
Math.Max(x,y) | Returns the largest of x and y. | Any numeric data type | The same type |
Math.Min(x,y) | Returns the smallest of x and y. | Any numeric data type | The same type |
Math.Pow(x,y) | Returns x raised to the power of y. | Double, Double | Double |
Math.Round(x,y) | Returns x rounded to y decimal places | Double, Integer | Double |
Math.Sign(x) | Returns -1 if x is negative, 0 if it is zero and 1 if positive. | Any numeric data type | The same type |
Math.Sin(x) | Returns the sine of x | Double | Double |
Math.Sqrt(x) | Returns the square root of x | Double | Double |
Math.Tan() | Returns the tangent of x | Double | Double |
Math.ToString(x) | Returns a human-readable representation of the object | Any object | String |
Math.Truncate(x) | Returns the integer part of x | Double/Decimal | Integer |
C#, like most programming languages does not work in degrees when performing trigonometric operations. Instead it works in radians. Worry not though, little one, it is easy to convert between the two.
Angle In Radians = Angle In Degrees * Math.Pi/180