-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolynomial.ctxt
More file actions
87 lines (87 loc) · 8.19 KB
/
Polynomial.ctxt
File metadata and controls
87 lines (87 loc) · 8.19 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#BlueJ class context
comment0.target=Polynomial
comment0.text=\r\n\ The\ Polynomial\ class\ is\ an\ abstract\ representation\ of\ a\ polynomial\ with\ N\ terms,\ where\ N\ equals\ coefficients.length.\r\n\ For\ example\:\ Ax^2+BX+C\ is\ a\ polynomial\ where\ coefficients[0]\=A,\ coefficients[1]\=B,\ coefficients[2]\=C.\r\n\ \r\n\ A\ main\ purpose\ of\ this\ class\ is\ to\ take\ multiple\ points\ into\ a\ constructer,\ and\ create\ a\ Polynomial\ that\ intersects\ all\ the\ points,\ with\ flowing\ curves.\r\n\ \r\n\ int[]\ points\ holds\ the\ points\ that\ were\ initially\ used\ to\ create\ the\ Polynomial,\ in\ the\ format\ of\ x1,y1,x2,y2,x3,y3...\r\n
comment1.params=p
comment1.target=Polynomial(Polynomial)
comment10.params=coefficients
comment10.target=void\ setCoefficients(double[])
comment10.text=\r\n\ If\ the\ function\ is\ represented\ by\ Ax^3+BX^2+CX+D,\ this\ method\ replace\ those\ A,B,C,D\ with\ new\ values.\r\n\ @param\ coefficients\ This\ will\ set\ the\ A,B,C,D...\ values\ to\ the\ values\ found\ in\ coefficients.\r\n
comment11.params=
comment11.target=int[]\ getPoints()
comment12.params=points
comment12.target=void\ getPoints(int[])
comment13.params=xShift
comment13.target=void\ setXShift(int)
comment13.text=\r\n\ This\ method\ sets\ how\ much\ the\ graph\ is\ shifted\ in\ the\ X\ axis.\r\n\ @param\ xShift\ The\ value\ to\ shift\ the\ graph\ by.\r\n
comment14.params=xChange
comment14.target=void\ changeXShift(int)
comment14.text=\r\n\ This\ method\ changes\ xShift\ by\ xChange\ pixels.\ For\ example\ if\ the\ graph\ was\ shifted\ over\ 150\ pixels,\ and\ this\ method\ was\ called\ with\ xChange\=25\r\n\ the\ graph\ would\ shift\ over\ an\ additional\ 25\ pixels,\ with\ a\ final\ xShift\ value\ of\ 175.\r\n\ @param\ xChange\ The\ value\ to\ shift\ the\ graph\ by.\r\n
comment15.params=
comment15.target=int\ getXShift()
comment15.text=\r\n\ @return\ Returns\ the\ amount\ the\ graph\ is\ shifted\ by.\r\n
comment16.params=yShift
comment16.target=void\ setYShift(int)
comment16.text=\r\n\ This\ method\ sets\ the\ YShift\ value,\ which\ is\ used\ to\ shift\ the\ whole\ graph\ up\ or\ down.\r\n\ @param\ yShift\ The\ value\ to\ shift\ the\ graph\ by.\r\n
comment17.params=yChange
comment17.target=void\ changeYShift(int)
comment17.text=\r\n\ This\ method\ changes\ yShift\ by\ yChange\ pixels.\ For\ example\ if\ the\ graph\ was\ shifted\ over\ 150\ pixels,\ and\ this\ method\ was\ called\ with\ yChange\=25\r\n\ then\ the\ graph\ would\ shift\ down\ an\ additional\ 25\ pixels,\ with\ a\ final\ yShift\ value\ of\ 175.\ \r\n\ \r\n\ Please\ note\ that\ y\=0\ is\ at\ the\ top\ of\ the\ screen,\ and\ that\ the\ bottom\ of\ the\ screen\ is\ a\ positive\ value\ getHeight(),\r\n\ which\ can\ be\ called\ from\ the\ DrawPanel\ class.\r\n\ \r\n\ \r\n\ @param\ xChange\ The\ value\ to\ shift\ the\ graph\ by.\r\n
comment18.params=
comment18.target=int\ getYShift()
comment18.text=\r\n\ @return\ Returns\ the\ value\ the\ graph\ is\ shifted\ by\ in\ the\ Y\ axis.\r\n
comment19.params=
comment19.target=java.awt.Color\ getColor()
comment19.text=\r\n\ @return\ Returns\ the\ color\ of\ this\ Polynomial.\r\n
comment2.params=info
comment2.target=Polynomial(java.lang.String[])
comment2.text=\r\n\ This\ is\ a\ constructer\ designed\ to\ construct\ a\ Polynomial\ from\ file.\ A\ .txt\ File\ is\ read,\ and\ separated\ into\ multiple\ String[]\ objects,\ one\ for\ each\ Polynomial.\r\n\ Then\ each\ discreet\ String[]\ is\ fed\ into\ this\ constructer.\ All\ the\ polynomials\ are\ then\ used\ to\ instantiate\ a\ Level\ object.\r\n
comment20.params=color
comment20.target=void\ setColor(java.awt.Color)
comment20.text=\r\nSets\ the\ color\ of\ this\ polynomial.\r\n@param\ color\ The\ color\ this\ Polynomial\ will\ be\ set\ to.\r\n
comment21.params=points\ start\ stop
comment21.target=Polynomial(int[],\ int,\ int)
comment21.text=\r\nCreates\ a\ Polynomial\ from\ an\ array\ of\ points,\ a\ start,\ and\ a\ stop\ value.\r\n@param\ points\ The\ points\ used\ to\ generate\ the\ function.\r\n@param\ start\ Starting\ value\ of\ the\ funciton.\r\n@param\ stop\ The\ right\ bound\ of\ the\ function.\r\n
comment22.params=wrapper\ start\ stop
comment22.target=Polynomial(double[],\ int,\ int)
comment23.params=points
comment23.target=double[]\ solve(double[])
comment23.text=\r\nThis\ method\ takes\ an\ array\ of\ points,\ in\ double\ format\ to\ ensure\ arithmetic\ precision,\ and\ converts\ it\ to\ the\r\ncoefficients\ of\ a\ polynomial\ that\ intersects\ the\ given\ points.\ This\ is\ most\ important\ method\ in\ this\ class.\r\n@param\ points\ A\ series\ of\ points\ formatted\ as\ an\ array\ of\ doubles.\r\n
comment24.params=g
comment24.target=void\ draw(java.awt.Graphics)
comment24.text=\r\n\ Obsolete\ method.\ Draws\ a\ Polynomial\ object.\r\n\ @param\ g\ This\ is\ the\ Graphics\ Object\ that\ is\ being\ used\ to\ draw.\ By\ accepting\ a\ Graphics\ Object\ as\ a\r\n\ parameter\ it\ allows\ the\ drawing\ to\ be\ done\ within\ each\ individual\ class,\ rather\ than\ have\ a\ superfluous\ amount\ of\ code\ in\ the\ driver.\r\n
comment25.params=g\ globalX\ globalY
comment25.target=void\ globalDraw(java.awt.Graphics,\ int,\ int)
comment25.text=\r\n\ \ Draws\ a\ Polynomial\ object\ with\ respect\ to\ a\ global\ shift\ variable.\r\n\ @param\ g\ This\ is\ the\ Graphics\ Object\ that\ is\ being\ used\ to\ draw.\ By\ accepting\ a\ Graphics\ Object\ as\ a\r\n\ parameter\ it\ allows\ the\ drawing\ to\ be\ done\ within\ each\ individual\ class,\ rather\ than\ have\ a\ superfluous\ amount\ of\ code\ in\ the\ driver.\r\n\ @param\ globalX\ An\ external\ variable\ that\ is\ used\ to\ shift\ the\ graph,\ used\ in\ relation\ to\ a\ moving\ point\ of\ reference.\r\n\ @param\ globalY\ Shifts\ the\ graph\ vertically\ by\ this\ value.\r\n
comment26.params=x
comment26.target=int\ height(int)
comment26.text=\r\n\ Returns\ the\ height\ of\ this\ Polynomial\ without\ respect\ to\ any\ xShift\ or\ globalX\ shifting\ variables.\r\n\ @param\ x\ this\ is\ the\ x\ in\ y\=f(x)\r\n\ @return\ returns\ the\ y\ value\ as\ a\ function\ of\ the\ x\ value.\r\n
comment27.params=value
comment27.target=int[]\ equals(double)
comment27.text=\r\n\ returns\ all\ X\ values\ where\ F(X)\=value\r\n\ @param\ value\ a\ value\ searched\ for.\r\n\ @return\ returns\ the\ x\ coordinates\ where\ f(x)\=value\r\n
comment28.params=x
comment28.target=double\ doubleHeight(int)
comment28.text=\r\n\ Returns\ the\ height\ with\ double\ precision.\r\n\ @param\ x\ value\ inputted\r\n\ @return\ returns\ the\ y\ value\ as\ a\ function\ of\ x.\r\n
comment29.params=
comment29.target=java.lang.String[]\ save()
comment29.text=\r\n\ This\ method\ was\ designed\ to\ be\ used\ in\ conjustion\ with\ the\ Level.save()\ method.\r\n\ The\ returned\ String[]\ is\ appended\ to\ a\ .txt\ file\ that\ contains\ all\ the\ Polynomials\ in\ the\ Level\ object.\r\n\ \r\n\r\n\ @return\ \ \ \ \ \ This\ returns\ a\ list\ of\ String\ that\ contains\ all\ the\ data\ held\ in\ a\ Polynomial.\ \r\n
comment3.params=
comment3.target=void\ print()
comment3.text=\r\n\ Primarily\ for\ demo\ purposes,\ this\ method\ prints\ all\ the\ key\ data\ held\ in\ a\ Polynomial.\r\n
comment4.params=start\ stop
comment4.target=void\ setBounds(int,\ int)
comment4.text=\r\n\ This\ sets\ the\ bounds\ of\ the\ polynomial.\ A\ polynomial\ is\ continuous\ (-infinity,infinity),\r\n\ therefore\ bounds\ must\ be\ set\ to\ determine\ what\ part\ of\ the\ function\ is\ graphed.\r\n\ \r\n\ @param\ start\ The\ left\ bound.\r\n\ @param\ stop\ The\ right\ bound.\r\n
comment5.params=start
comment5.target=void\ setStart(int)
comment5.text=\r\n\ This\ sets\ the\ left\ bound\ only.\r\n\ \r\n\ @param\ start\ The\ left\ bound.\r\n
comment6.params=stop
comment6.target=void\ setStop(int)
comment6.text=\r\n\ This\ sets\ the\ right\ bound\ only.\r\n\ \r\n\ @param\ stop\ The\ right\ bound.\r\n
comment7.params=
comment7.target=int\ getStart()
comment7.text=\r\n\ @return\ Returns\ the\ left\ bound\ of\ the\ graph.\r\n
comment8.params=
comment8.target=int\ getStop()
comment8.text=\r\n\ @return\ Returns\ the\ right\ bound\ of\ the\ graph.\r\n
comment9.params=
comment9.target=double[]\ getCoefficients()
comment9.text=\r\n\ @return\ Returns\ the\ coefficients\ that\ form\ the\ Polynomial.\ If\ the\ function\ is\ represented\ by\ Ax^3+BX^2+CX+D,\r\n\ it\ returns\ A,B,C,D\ in\ a\ double[].\r\n
numComments=30