-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComplexes.cs
More file actions
57 lines (54 loc) · 1.31 KB
/
Complexes.cs
File metadata and controls
57 lines (54 loc) · 1.31 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TEST_lire_ecrire_image
{
class Complexes
{
public double a; //partie réelle
public double b; //partie imaginaire
public Complexes(double a, double b)
{
this.a = a;
this.b = b;
}
public void Square()
{
double temp = (a * a) - (b * b);
b = 2.0 * a * b;
a = temp;
}
public double Module()
{
return Math.Sqrt((a * a) + (b * b));
}
public void Inverse()
{
a = a / Module();
b = -b / Module();
}
public void Sub(Complexes c)
{
a -= c.a;
b -= c.b;
}
public void Add(Complexes c)
{
a += c.a;
b += c.b;
}
public void Conjugue()
{
b = -b;
}
public double[] Tan()
{
a = Math.Sin(2 * a) / (Math.Cos(2 * a) + Math.Cosh(2 * b));
b = Math.Sinh(2 * b) / (Math.Cos(2 * a) + Math.Cosh(2 * b));
double[] tan = { a, b };
return tan;
}
}
}