www.erzenisma.com

FORUMI
 
HomeCalendarGalleryFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 Java script

View previous topic View next topic Go down 
AuthorMessage
Net $er$eri
Admin
Admin
avatar

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

PostSubject: Java script   Tue 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
View user profile http://www.erzenisma.com
 
Java script
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» how to select dropdown value
» Javascript Array
» Getting error when i run selenium script in Eclipse, please help
» Verify command when used with Java,JUNIT and Eclipse
» opera browser not loading the page using selenium Rc(Java)

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