www.erzenisma.com
Would you like to react to this message? Create an account in a few clicks or log in to continue.
www.erzenisma.com

FORUMI
 
HomeGallerySearchLatest imagesRegisterLog in

 

 Java script

Go down 
AuthorMessage
Net $er$eri
Admin
Admin
Net $er$eri


Number of posts : 42
Age : 36
Registration date : 2006-11-11

Java script Empty
PostSubject: Java script   Java script Icon_minitimeTue Nov 14, 2006 6:43 pm

Detyra kerkon nje Pie qe shfrytezuesi ta ndaj ne pjese sa te doje. E kam perfundu po s'po mund ta eliminoj nje 'jo saktesi' matematike. E di sakte ku osht po spo kam ide qysh me rregullu. Ndonji ide apo dicka qe nuk po di qe kish me rregullu ket Pie qe po du me nda SAKT...

algoritmi duket:

int ndarja = // Shfrytezuesi ka mundsi me nda nga 1 - 360 pjese
float shkallet = (float) 360 / ndarja;
for (int i = 0; i < ndarja; i++)
{ float kendi_fillues_i_ardhshem = (float)i * shkallet;
g.fillArc(100, 100, 450, 450, (int)kendi_fillues_i_ardhshem, (int)shkallet);
}
...

Problemi eshte se kur p.sh. ndarja jepet numer qe nuk perpjestohet me 360 shkallet rezultojne numer me shume shifra pas presjes dhjetore dhe kjo e humb saktesine e algoritmit tim. Kjo ndodh sepse kur cilkli ec para, kendi_fillues_i_ardhshem varet natyrisht nga shkallet qe nuk kane ndonje vlere te sakte(!!!)
Back to top Go down
http://www.erzenisma.com
 
Java script
Back to top 
Page 1 of 1
 Similar topics
-
» Java Builder
» Hyrje ne JAVA

Permissions in this forum:You cannot reply to topics in this forum
www.erzenisma.com :: "PROGRAMIMI" :: JAVA-
Jump to: