-
Notifications
You must be signed in to change notification settings - Fork 0
/
Circle.java
62 lines (58 loc) · 1.73 KB
/
Circle.java
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
60
61
62
class Circle
{
double hypotenius;
double perpendicular;
double base;
public Circle(double hypotenius,double perpendicular,double base)
{
this.hypotenius=hypotenius;
this.perpendicular=perpendicular;
this.base=base;
}
public double getHyp(double perpendicular,double base)
{
this.perpendicular=Math.pow(perpendicular,2);
this.base=Math.pow(base,2);
this.hypotenius=this.perpendicular+this.base;
return this.hypotenius;
}
public double getPerp(double hypotenius,double base)
{
this.hypotenius=Math.pow(hypotenius,2);
this.base=Math.pow(base,2);
this.perpendicular=this.hypotenius-this.base;
return this.perpendicular;
}
public double getBas(double perpendicular,double hypotenius)
{
this.perpendicular=Math.pow(perpendicular,2);
this.hypotenius=Math.pow(hypotenius,2);
this.base=this.hypotenius-this.perpendicular;
return this.base;
}
public double getHyp(double perpendicular,float angle)
{
this.hypotenius=(this.perpendicular/Math.sin(angle));
return this.hypotenius;
}
public double getPerp(double hypotenius,float angle)
{
this.perpendicular=(Math.sin(angle)*this.hypotenius);
return this.perpendicular;
}
public double getBas(double perpendicular,float angle)
{
this.base=(this.perpendicular*Math.tan(angle));
return this.base;
}
public static void main(String []arg)
{
Circle c1=new Circle(3,5,6);
System.out.println("Hypertenious"+c1.getHyp(10,2));
System.out.println("Base: "+c1.getBas(11,2));
System.out.println("Perpendicular"+c1.getPerp(32,4));
System.out.println("Hypertenious"+c1.getHyp(10,2f));
System.out.println("Base: "+c1.getBas(11,2f));
System.out.println("Perpendicular"+c1.getPerp(32,4f));
}
}