Peningkatan Ketelitian

Dependencies:   mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
andremanurung
Date:
Fri May 17 02:55:41 2019 +0000
Parent:
14:ac60009841bd
Commit message:
baru

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ac60009841bd -r 9ee2f71056f7 main.cpp
--- a/main.cpp	Fri May 17 02:21:05 2019 +0000
+++ b/main.cpp	Fri May 17 02:55:41 2019 +0000
@@ -111,7 +111,7 @@
         if(yt==0.00){
             yt+=0.000001;        
         }else if(yt==r1+r2){
-            yt-=0.1;
+            yt-=0.000001;
         }
         if(zt==0.00){
             zt+=0.000001;        
@@ -130,7 +130,7 @@
             deg+=0.03;
             rad=deg*pi/180;
             
-            if ((xt>0)&&(zt>00)){
+            if ((xt>0)&&(zt>0)){
                 if(kons>abs(diffeI(rad,xt,yt,zt,r1,r2))){     //jika diffeI mendekati 0 (<0.01) dan bukan nan, 
                     break;                              //maka sudut tersebut memenuhi
                 }
@@ -138,6 +138,8 @@
                 if(kons>abs(diffeIV(rad,xt,yt,zt,r1,r2))){     //jika diffeIV mendekati 0 (<0.01) dan bukan nan, 
                     break;                              //maka sudut tersebut memenuhi
                 }
+            }else{
+                pc.printf("Ada kemungkinan koordinat tidak dapat dijangkau ini tidak dapat terjadi (bukan kuadran I atau IV"); 
             }
         }