-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphingLines.java
More file actions
67 lines (56 loc) · 1.24 KB
/
Copy pathGraphingLines.java
File metadata and controls
67 lines (56 loc) · 1.24 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
58
59
60
61
62
63
64
65
66
67
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package assignment_10528808;
/**
*
* @author Mawutor
*/
import java.awt.Color;
public class GraphingLines
{
public static void main( String[] args )
{
double y, y2;
GraphPaper gp1 = new GraphPaper(10,10);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
gp1.drawPoint(x,y);
}
GraphPaper gp2 = new GraphPaper(320,10);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
gp2.drawPoint(x,y);
}
GraphPaper gp3 = new GraphPaper(630,10);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
gp3.drawPoint(x,y);
}
GraphPaper gp4 = new GraphPaper(10,320);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
gp4.drawPoint(x,y);
}
GraphPaper gp5 = new GraphPaper(320,320);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
y2 = 1*x + 1;
gp5.drawPoint(x,y);
gp5.drawPoint(x,y2);
}
GraphPaper gp6 = new GraphPaper(630,320);
for ( double x = -10; x<=10; x+=0.01 )
{
y = 1*x + 0;
gp6.drawPoint(x,y);
}
}
}