| |
|
|
- Page 1 - |
|
 | Hey could me Please of/ one the explicit More mathematically formed XProfan on The Sprünge help ? I see whom woods to Bäumen not any more 
everything I wants is a speedy function from the way xy,xxyy me whom winkel (360°!) returns.
my code functions already - naja almost. CompileMarkSeparationCLS
WHILE 1
CLS
PRINT WNK(100,100,%MOUSEX,%MOUSEY)
SLEEP 100
ENDWHILE
WAITKEY
proc WNK
PARAMETERS X&,Y&,XX&,YY&
var T!=0
IF XX&<X&
RETURN WNK(XX&,Y&,X&,YY&)
ENDIF
IF YY&<Y&
RETURN WNK(X&,YY&,XX&,Y&)
ENDIF
LINE X&,Y& - XX&,YY&
var DX!=XX&-X&
var DY!=YY&-Y&
T!=(SQRT(DX!*DX!+DY!*DY!))
IF YY&<XX&
T!=RAD2DEG(SINH(DY!/T!))
ELSE
T!=45+(45-RAD2DEG(SINH(DX!/T!)))
ENDIF
RETURN T!
endproc
proc RAD2DEG
PARAMETERS ANGLE!
RETURN (180 / @PI()) * ANGLE!
endproc
proc SINH
PARAMETERS ANGLE!
RETURN (@EXP(ANGLE!) - @EXP(-ANGLE!)) / 2
./../function-references/XProfan/endproc/'>endproc
|
|
|
| |
|
|
|
| |
|
- Page 6 - |
|
 Hubert Binnewies | Tjaaaaaaaaaaaaaaaaaaaa....
How should I it say......
everything on beginning back....
in the attempt here the sine and Cosinus wegzulassen have I notice the my above-mentioned routine of course beautiful functions, but unfortunately not correctly.. on the place where eigendlich 45 strain come along should go 61 strain displayed. the lying on it the The pages one rechtwinkligen Dreiecks still not direct Relationship to the Winkeln standing, separate still go ahead whom Sinus and Cosinus the Winkel. Womit everything the I yet here written have absolute blödsinn is. woraus follows: the Praise to I was More as premature....
Hubert
P.s.: I consider moreover whether one there still what can make, but I faith not any more on it. |
|
|
| WinXP Prof, XProfan 9.1 Newbie
Ein kluger Kopf sagte mal: "Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!" | 12/08/06 ▲ |
|
|
|
|
 | Neinnein here's no praise premature because The Erkenntnis as such has still ihren worth! I crazy me too constantly and often too half-way therefore beabsichtig me at a incorrect idea hochzuhangeln around the experience to obtain Why it letztendlich fails.
If You mean The function goes mathematically not To beschläunigen - then having we So perhaps even the best way here exist. the to know is still plenty worth! |
|
|
| |
|
|
|
 Hubert Binnewies | Hello IF... it has me not losgelassen, whether I not still create at least your second Formel To curtail...
here's the Ergebniss...(and the functions , How one see can) CompileMarkSeparationCLS
Declare OUTPX!,OUTPY!
OUTPX!=0
OUTPY!=0
WHILELOOP 0,359
GETCIRCP(100,100,50,&LOOP)
SETPIXEL OUTPX!,OUTPY!,0
GETCIRCP(300,100,&LOOP/10,&LOOP*3)
SETPIXEL OUTPX!,OUTPY!,0
ENDWHILE
WAITKEY
END
proc GETCIRCP
PARAMETERS XP!,YP!,R!,W!
OUTPX!=(R!*(@Sin(0.0174532925199433*W!)))+XP!
OUTPY!=YP!-(R!*(@Sin(0.0174532925199433*(90-W!))))
endproc
can Yes time try the To benchen... be tensely whether it not still faster is
Hubert |
|
|
| WinXP Prof, XProfan 9.1 Newbie
Ein kluger Kopf sagte mal: "Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!" | 12/09/06 ▲ |
|
|
|
|
 Hubert Binnewies | so... your second Prob Have I me too time respected.... If you yet whom ArcSin vereinfachen would, ought to the still a tick faster his How Deins (not sure)...
Benche the still time.... CompileMarkSeparationCLS
declare T!,DX!,DY!
WHILE 1
CLS
print WNK(400,200,%MOUSEX,%MOUSEY)
SLEEP 50
ENDWHILE
WAITKEY
proc WNK
PARAMETERS X&,Y&,XX&,YY&
LINE X&,Y& - XX&,YY&
LINE X&,Y& - X&+100,Y&+100
if xx&-x&>0
if yy&-y&=0
T! = 0 <---können auch 360 Grad sein
elseif yy&-y&>0
T! = 57.29577951*@ArcSin((yy& - y&)/sqrt((xx& - x&)^2 + (yy& - y&)^2))
elseif yy&-y&<0
T! = 180-(57.29577951*@ArcSin((((yy& - y&)*-1)/sqrt((xx& - x&)^2 + ((yy& - y&)*-1)^2))))+180
endif
endif
if xx&-x&=0
if yy&-y&>0
T! = 90
elseif yy&-y&<0
T! = 270
endif
endif
if xx&-x&<0
if yy&-y&>0
T! = 90-(57.29577951*@ArcSin(((yy& - y&)/sqrt(((xx& - x&)*-1)^2 + (yy& - y&)^2))))+90
elseif yy&-y&=0
T! = 180
elseif yy&-y&<0
T! = 180+(57.29577951*@ArcSin((((yy& - y&)*-1)/sqrt(((xx& - x&)*-1)^2 + ((yy& - y&)*-1)^2))))
endif
endif
RETURN T!
endproc
Proc ArcSin
Parameters Angle!
Declare Ergebnis!
If @Abs(Angle!) = 1
Ergebnis! = Angle! * (@Pi() / 2)
Else
Ergebnis! = @ArcTan(Angle! / @Sqrt(1 - @Sqr(Angle!)))
EndIf
Return< gebnis!
ENDPROC
Hubert |
|
|
| WinXP Prof, XProfan 9.1 Newbie
Ein kluger Kopf sagte mal: "Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!" | 12/09/06 ▲ |
|
|
|
|
 | to that WNK - the second here from you is semi so quick How your first function The twice so quick was How my. ^^
here the BenchSource: CompileMarkSeparationDECLARE T!,DX!,DY!
RANDOMIZE
CLS
var TME&=&GETTICKCOUNT
WHILELOOP 10000
WNK(100,100,RND(200),RND(200))
ENDWHILE
TME&=&GETTICKCOUNT-TME&
var TME2&=&GETTICKCOUNT
WHILELOOP 10000
WNK2(100,100,RND(200),RND(200))
ENDWHILE
TME2&=&GETTICKCOUNT-TME2&
PRINT TME&
PRINT TME2&
WAITKEY
proc WNK
PARAMETERS X&,Y&,XX&,YY&
IF XX&-X&>0
IF YY&-Y&=0
T!=0
ELSEIF YY&-Y&>0
T!=57.29577951*@ARCSIN((YY& - Y&)/SQRT((XX& - X&)^2 + (YY& - Y&)^2))
ELSEIF YY&-Y&<0
T!=180-(57.29577951*@ARCSIN((((YY& - Y&)*-1)/SQRT((XX& - X&)^2 + ((YY& - Y&)*-1)^2))))+180
ENDIF
ENDIF
IF XX&-X&=0
IF YY&-Y&>0
T!=90
ELSEIF YY&-Y&<0
T!=270
ENDIF
ENDIF
IF XX&-X&<0
IF YY&-Y&>0
T!=90-(57.29577951*@ARCSIN(((YY& - Y&)/SQRT(((XX& - X&)*-1)^2 + (YY& - Y&)^2))))+90
ELSEIF YY&-Y&=0
T!=180
ELSEIF YY&-Y&<0
T!=180+(57.29577951*@ARCSIN((((YY& - Y&)*-1)/SQRT(((XX& - X&)*-1)^2 + ((YY& - Y&)*-1)^2))))
ENDIF
ENDIF
RETURN T!
endproc
proc ARCSIN
PARAMETERS ANGLE!
DECLARE ERGEBNIS!
IF @ABS(ANGLE!)=1
ERGEBNIS!=ANGLE! * (@PI() / 2)
ELSE
ERGEBNIS!=@ARCTAN(ANGLE! / @SQRT(1 - @SQR(ANGLE!)))
ENDIF
RETURN ERGEBNIS!
endproc
proc WNK2
PARAMETERS X!,Y!,XX!,YY!
var DX!=XX!-X!
var DY!=YY!-Y!
IF DX!>0
IF DY!>0
RETURN (90*(DY!))/SQRT((DX!)^2 + (DY!)^2)
ELSEIF DY!<0
RETURN 180-((90*((DY!)*-1))/SQRT((DX!)^2 + ((DY!)*-1)^2))+180
ELSE
RETURN 0
ENDIF
ELSEIF DX!<0
IF DY!>0
RETURN 90-((90*(DY!))/SQRT(((DX!)*-1)^2 + (DY!)^2))+90
ELSEIF DY!<0
RETURN 180+((90*((DY!)*-1))/SQRT(((DX!)*-1)^2 + ((DY!)*-1)^2))
ELSE
RETURN 180
ENDIF
ELSE
IF DY!>0
RETURN 90
ELSEIF DY!<0
RETURN 270
ELSE
RETURN 0
ENDIF
ENDIF RETURN T!
endproc
and now benche I time the GetCircP |
|
|
| |
|
|
|
 | Jau your GetCirp is twice so quick *grins* CompileMarkSeparationDECLARE COS_OUTPX!,COS_OUTPY!,OUTPX!,OUTPY!
RANDOMIZE
CLS
var TME&=&GETTICKCOUNT
WHILELOOP 10000
MYGETCIRCP(100,100,RND(100),RND(360))
ENDWHILE
TME&=&GETTICKCOUNT-TME&
var TME2&=&GETTICKCOUNT
WHILELOOP 10000
HBGETCIRCP(100,100,RND(100),RND(360))
ENDWHILE
TME2&=&GETTICKCOUNT-TME2&
PRINT TME&
PRINT TME2&
WAITKEY
proc HBGETCIRCP
PARAMETERS XP!,YP!,R!,W!
OUTPX!=(R!*(@SIN(0.0174532925199433*W!)))+XP!
OUTPY!=YP!-(R!*(@SIN(0.0174532925199433*(90-W!))))
endproc
proc MYGETCIRCP
PARAMETERS XP!,YP!,R!,W!
COS_OUTPX!=((((R!*SIN(((-1*(((-1+W!)*3.1415926535897932384626433832795)+3.1415926535897932384626433832795))/180))))*-1)+XP!)
COS_OUTPY!=((((R!*COS(((-1*(((-1+W!)*3.1415926535897932384626433832795)+3.1415926535897932384626433832795))/180))))*-1)+YP!)
endproc
|
|
|
| |
|
|
|
 Hubert Binnewies | @IF To 1 )Benche not against my old routine, The rechnet still not correctly.. Benche against your previous routine, and try the Proc ArcSin To vereinfachen, the power The thing faster.
To2 ) siehste....has still what brought.... ...(is but Nich integrally as accurate How your....a couple to put hinterm comma less)... |
|
|
| WinXP Prof, XProfan 9.1 Newbie
Ein kluger Kopf sagte mal: "Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!" | 12/09/06 ▲ |
|
|
|
|
 | oje habs understood! is me entgangen the that here: CompileMarkSeparation not calculate properly. would be very pity was twice as quick. |
|
|
| |
|
|
|
 | OK here The results 10.000 in sec:
my: 2,7 your1: 1,6 your2: 2,6
:--/ |
|
|
| |
|
|
|
 | try now arcsin To vereinfachen... |
|
|
| |
|
|
|
 Hubert Binnewies | Nachtrag....
The justice halber (and of my Stolzes because of over of my Verlobten) must I here yet allude, the The Formel not integrally on my Mist grown is, separate as i NEN Hänger having (No...Nich so a...tztz...) my pearl your Matheunterlagen rausnahm (tappt im dunkeln straightens ihren Realschulabschluss to) having tappt im dunkeln me with of/ one small Discussion into right direction geschubst.....
as Thanks promising I your tappt im dunkeln here dankend To allude, I herewith make.
Hubert |
|
|
| WinXP Prof, XProfan 9.1 Newbie
Ein kluger Kopf sagte mal: "Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!" | 12/12/06 ▲ |
|
|
|
| |
|
- Page 7 - |
|
|
 | |
|
| |
|
|