Permalink
Browse files

bumped up graph resolution (might be too slow)

  • Loading branch information...
1 parent 27457e7 commit 7160c24f9f11d7b27189e9aae0d08c5efa1a9b06 @Xlythe committed Aug 1, 2012
View
@@ -5,7 +5,7 @@
android:versionName="1.0"
android:installLocation="auto">
- <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15"/>
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher_calculator">
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -430,14 +430,14 @@ public void run(){
final GraphicalView graph = (GraphicalView) mContext.findViewById(R.id.graphView);
if(equation[0].equals(mY) && !equation[1].contains(mY)){
- for(double x=-10;x<=10;x+=0.1){
+ for(double x=-10;x<=10;x+=0.025){
if(!eq.equals(getText())) return;
try{
mSymbols.define(mX, x);
double y = mSymbols.eval(equation[1]);
- if(y>(Graph.MAX_HEIGHT_Y*1000) || y<(Graph.MIN_HEIGHT_Y*1000) || y==Double.NaN){
+ if(y>(Graph.MAX_HEIGHT_Y*2) || y<(Graph.MIN_HEIGHT_Y*2) || y==Double.NaN){
//If we're not exactly on the mark with a break in the graph, we get lines where we shouldn't like with y=1/x
//Better to be safe and just treat anything a lot larger than the min/max height to be a break then pray we're perfect and get NaN
series.add(x, MathHelper.NULL_VALUE);
@@ -451,14 +451,14 @@ public void run(){
}
}
else if(equation[0].equals(mX) && !equation[1].contains(mX)){
- for(double y=-10;y<=10;y+=0.1){
+ for(double y=-10;y<=10;y+=0.025){
if(!eq.equals(getText())) return;
try{
mSymbols.define(mY, y);
double x = mSymbols.eval(equation[1]);
- if(x>(Graph.MAX_HEIGHT_X*1000) || x<(Graph.MIN_HEIGHT_X*1000) || x==Double.NaN){
+ if(x>(Graph.MAX_HEIGHT_X*2) || x<(Graph.MIN_HEIGHT_X*2) || x==Double.NaN){
series.add(MathHelper.NULL_VALUE, y);
}
else{
@@ -470,14 +470,14 @@ else if(equation[0].equals(mX) && !equation[1].contains(mX)){
}
}
else if(equation[1].equals(mY) && !equation[0].contains(mY)){
- for(double x=-10;x<=10;x+=0.1){
+ for(double x=-10;x<=10;x+=0.025){
if(!eq.equals(getText())) return;
try{
mSymbols.define(mX, x);
double y = mSymbols.eval(equation[0]);
- if(y>(Graph.MAX_HEIGHT_Y*1000) || y<(Graph.MIN_HEIGHT_Y*1000) || y==Double.NaN){
+ if(y>(Graph.MAX_HEIGHT_Y*2) || y<(Graph.MIN_HEIGHT_Y*2) || y==Double.NaN){
series.add(x, MathHelper.NULL_VALUE);
}
else{
@@ -489,14 +489,14 @@ else if(equation[1].equals(mY) && !equation[0].contains(mY)){
}
}
else if(equation[1].equals(mX) && !equation[0].contains(mX)){
- for(double y=-10;y<=10;y+=0.1){
+ for(double y=-10;y<=10;y+=0.025){
if(!eq.equals(getText())) return;
try{
mSymbols.define(mY, y);
double x = mSymbols.eval(equation[0]);
- if(x>(Graph.MAX_HEIGHT_X*1000) || x<(Graph.MIN_HEIGHT_X*1000) || x==Double.NaN){
+ if(x>(Graph.MAX_HEIGHT_X*2) || x<(Graph.MIN_HEIGHT_X*2) || x==Double.NaN){
series.add(MathHelper.NULL_VALUE, y);
}
else{
@@ -508,8 +508,8 @@ else if(equation[1].equals(mX) && !equation[0].contains(mX)){
}
}
else{
- for(double x=-10;x<=10;x+=0.5){
- for(double y=10;y>=-10;y-=0.5){
+ for(double x=-10;x<=10;x+=0.1){
+ for(double y=10;y>=-10;y-=0.1){
if(!eq.equals(getText())) return;
try{
mSymbols.define(mX, x);

0 comments on commit 7160c24

Please sign in to comment.