-
Notifications
You must be signed in to change notification settings - Fork 1
/
GraphingParabolas.java
66 lines (57 loc) · 1.23 KB
/
GraphingParabolas.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
63
64
65
66
import java.awt.Color;
public class GraphingParabolas
{
public static void main( String[] args )
{
double y;
double a, h, k;
GraphPaper gp1 = new GraphPaper(10,10);
for ( double x = -10; x<=10; x+=0.01 )
{
a = 1;
h = 0; k = 0;
y = a*Math.pow(x-h,2) + k;
gp1.drawPoint(x,y);
}
GraphPaper gp2 = new GraphPaper(320,10);
for ( double x = -10; x<=10; x+=0.01 )
{
a = 1;
h = 4; k = 5;
y = a*Math.pow(x-h,2) + k;
gp2.drawPoint(x,y);
}
GraphPaper gp3 = new GraphPaper(630,10);
for ( double x = -10; x<=10; x+=0.01 )
{
a = 1.0/2.0;
h = -1; k = -3;
y = a*Math.pow(x-h,2) + k;
gp3.drawPoint(x,y);
}
GraphPaper gp4 = new GraphPaper(10,320);
for ( double x = -10; x<=10; x+=0.01 )
{
a = 3;
h = 0; k = 0;
y = a*Math.pow(x-h,2) + k;
gp4.drawPoint(x,y);
}
GraphPaper gp5 = new GraphPaper(320,320);
for ( double x = -10; x<=10; x+=0.01 )
{
a = 2;
h = -3; k = 4;
y = a*Math.pow(x-h,2) + k;
gp5.drawPoint(x,y);
}
GraphPaper gp6 = new GraphPaper(630,320);
for ( double x = -10; x<=10; x+=0.01 )
{
a = -5.0/9.0;
h = -5; k = 5;
y = a*Math.pow(x-h,2) + k;
gp6.drawPoint(x,y);
}
}
}