FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaProjects/src/Complexos.java at master · AndreUTF/JavaProjects · GitHub
AndreUTF
/
JavaProjects
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaProjects
/
src
/
Complexos.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (59 loc) · 3.33 KB
Breadcrumbs
JavaProjects
/
src
/
Complexos.java
Copy path
File metadata and controls
59 lines (59 loc) · 3.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
58
59
public
class
Complexos
{
//Angulos em radianos
public
static
void
Conversaoretpolar
(
double
partereal
,
double
parteimaginaria
){
double
angulo
,
modulo
;
modulo
=
Math
.
sqrt
(
Math
.
pow
(
partereal
,
2
)+
Math
.
pow
(
parteimaginaria
,
2
));
angulo
=
Math
.
acos
(
partereal
/
modulo
);
System
.
out
.
printf
(
"%.5f<%.5f
\n
"
,
modulo
,
angulo
);
}
public
static
void
Conversaopolarret
(
double
modulo
,
double
angulo
){
double
partereal
,
parteimaginaria
;
partereal
=
Math
.
cos
(
angulo
)*
modulo
;
parteimaginaria
=
Math
.
sin
(
angulo
)*
modulo
;
System
.
out
.
printf
(
"%.5f+i*%.5f
\n
"
,
partereal
,
parteimaginaria
);
}
public
static
void
Somaret
(
double
partereal1
,
double
parteimaginaria1
,
double
partereal2
,
double
parteimaginaria2
){
System
.
out
.
printf
(
"%.5f+i*%.5f
\n
"
,
partereal1
+
partereal2
,
parteimaginaria1
+
parteimaginaria2
);
}
public
static
void
Somapolar
(
double
modulo1
,
double
angulo1
,
double
modulo2
,
double
angulo2
){
double
parterealt
,
parteimaginariat
,
modulot
,
angulot
;
parterealt
=
Math
.
cos
(
angulo1
)*
modulo1
+
Math
.
cos
(
angulo2
)*
modulo2
;
parteimaginariat
=
Math
.
sin
(
angulo1
)*
modulo1
+
Math
.
sin
(
angulo2
)*
modulo2
;
modulot
=
Math
.
sqrt
(
parterealt
*
parterealt
+
parteimaginariat
*
parteimaginariat
);
angulot
=
Math
.
acos
(
parterealt
/
modulot
);
System
.
out
.
printf
(
"%.5f<%.5f
\n
"
,
modulot
,
angulot
);
}
public
static
void
Subtracaoret
(
double
partereal1
,
double
parteimaginaria1
,
double
partereal2
,
double
parteimaginaria2
){
System
.
out
.
printf
(
"%.5f+i*%.5f
\n
"
,
partereal1
-
partereal2
,
parteimaginaria1
-
parteimaginaria2
);
}
public
static
void
Subtracaopolar
(
double
modulo1
,
double
angulo1
,
double
modulo2
,
double
angulo2
){
double
parterealt
,
parteimaginariat
,
modulot
,
angulot
;
parterealt
=
Math
.
cos
(
angulo1
)*
modulo1
-
Math
.
cos
(
angulo2
)*
modulo2
;
parteimaginariat
=
Math
.
sin
(
angulo1
)*
modulo1
-
Math
.
sin
(
angulo2
)*
modulo2
;
modulot
=
Math
.
sqrt
(
parterealt
*
parterealt
+
parteimaginariat
*
parteimaginariat
);
angulot
=
Math
.
acos
(
parterealt
/
modulot
);
System
.
out
.
printf
(
"%.5f<%.5f
\n
"
,
modulot
,
angulot
);
}
public
static
void
Multiplicacaoret
(
double
partereal1
,
double
parteimaginaria1
,
double
partereal2
,
double
parteimaginaria2
){
System
.
out
.
printf
(
"%.5f+i*%.5f
\n
"
,
partereal1
*
partereal2
,
parteimaginaria1
*
parteimaginaria2
);
}
public
static
void
Multiplicacaopolar
(
double
modulo1
,
double
angulo1
,
double
modulo2
,
double
angulo2
){
double
parterealt
,
parteimaginariat
,
modulot
,
angulot
;
parterealt
=
Math
.
cos
(
angulo1
)*
modulo1
*
Math
.
cos
(
angulo2
)*
modulo2
;
parteimaginariat
=
Math
.
sin
(
angulo1
)*
modulo1
*
Math
.
sin
(
angulo2
)*
modulo2
;
modulot
=
Math
.
sqrt
(
parterealt
*
parterealt
+
parteimaginariat
*
parteimaginariat
);
angulot
=
Math
.
acos
(
parterealt
/
modulot
);
System
.
out
.
printf
(
"%.5f<%.5f
\n
"
,
modulot
,
angulot
);
}
public
static
void
Divisaoret
(
double
partereal1
,
double
parteimaginaria1
,
double
partereal2
,
double
parteimaginaria2
){
System
.
out
.
printf
(
"%.5f+i*%.5f
\n
"
,(
partereal1
/
partereal2
),(
parteimaginaria1
/
parteimaginaria2
));
}
public
static
void
Divisaopolar
(
double
modulo1
,
double
angulo1
,
double
modulo2
,
double
angulo2
){
double
parterealt
,
parteimaginariat
,
modulot
,
angulot
;
parterealt
= ((
Math
.
cos
(
angulo1
)*
modulo1
)/(
Math
.
cos
(
angulo2
)*
modulo2
));
parteimaginariat
= ((
Math
.
sin
(
angulo1
)*
modulo1
)/(
Math
.
sin
(
angulo2
)*
modulo2
));
modulot
=
Math
.
sqrt
(
parterealt
*
parterealt
+
parteimaginariat
*
parteimaginariat
);
angulot
=
Math
.
acos
(
parterealt
/
modulot
);
System
.
out
.
printf
(
"%.5f<%.5f
\n
"
,
modulot
,
angulot
);
}
}
Back
|
FazBrowse Home
|
New Git URL