-
Notifications
You must be signed in to change notification settings - Fork 0
/
Algebra.cs
33 lines (29 loc) · 917 Bytes
/
Algebra.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace randomImage
{
class Algebra // this is general algebra class for computing certain mathematical operations
{
// method to convert angle in degree into radian angle
public static double convertToRad(double angleInDegrees)
{
return (Math.PI / 180) * angleInDegrees;
}
// making a swap method for interchanging the two variables values
public static void swap(double a, double b)
{
double t = a;
a = b;
b = t;
}
// to get the random number
public static double getRandomNumber(double minimum, double maximum)
{
Random random = new Random();
return random.NextDouble() * (maximum - minimum) + minimum;
}
}
}