|  |  | 
|  | 
|  | 
| - page 1 - | 
| 
 
 | 
|  | | Hey pourrait mir s'il te plaît einer qui deutlich plus mathématique gebildeten XProfaner sur qui Sprünge aider ? je vois den forêt avant Bäumen pas plus  
 Alles quoi je veux ist une schnelle Funktion qui aus qui Strecke xy,xxyy mir den winkel (360°!) zurückliefert.
 
 mon Code funktioniert déjà - bof presque.
 KompilierenMarqueSéparation
 CLS
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 2 - | 
| 
 
 | 
|  | 
|  | | ok *180/pi pourrait on encore dans *57.295779513082320876798154814105 ersetzen... | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Jac
 de
 Lad
 | | comment du meinst...  | 
 | 
|  | 
|  | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
 | 05.12.2006  ▲ | 
 | 
|  | 
| 
 
 
 | 
|  | 
|  | | bien sûr volontiers mach je... je bau la fois nen PerformanceCheck drunter mais Deins ist besser vois je maintenant déjà mom... | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Jac
 de
 Lad
 | | 180/Pi  ist mais etwa 57.295779513082320876798154814105170332405472466564321549160243861202847148321552632440968995851110944186223381632864893281448264601248315036068267863411942122526388097467267926307988702893110767938261442638263158209610460487020506444259656841120171912057738566280431284962624203376187937297623870790340315980719624089522045186205459923396314841906966220115126609691801514787637366923164107126774038514690165499594192515711986479435210661624389035202306756177796757113315683506205731313360156501348898018788709918 
 
  | 
 | 
|  | 
|  | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
 | 05.12.2006  ▲ | 
 | 
|  | 
| 
 
 
 | 
|  | 
|  | | Hm ne Deins gibt Je ne den Winkel dans Grad exposition la fois zum comparaison beide Procs: KompilierenMarqueSéparation
  {$cleq}
const myPi=3.1415926535897932384626433832795
cls
while 1
    cls
    print int(wnk(100,100,mousex,mousey,false)),"°  "
    print winkel(100,100,mousex,mousey),"°"
    sleep 50
wend
waitkey
proc wnk(float x1,y1,x2,y2,int mode)
    float x= sub ( x2! , x1! )
    float y= sub ( y2! , y1! )
    line x1,y1 - x2,y2
    case (x<0) and (y<0) : return wnk(x2,y2,x1,y1,3)
    case x<0 : return wnk(x2,y1,x1,y2,1)
    case y<0 : return wnk(x1,y2,x2,y1,2)
    casenot x : x=0.0000001
    casenot y : y=0.0000001
    float w=arctan(y/x)*57.295779513082320876798154814105
    if (mode==1)
        w:=90+(90-w)
    elseif (mode==2)
        w:=360-w
    elseif (mode==3)
        w:=180+w
    endif
    return w
endproc
proc Winkel
    Parameters x1!,y1!,x2!,y2!
    declare dx!,dy!
    dx!=x2!-x1!
    dy!=y1!-y2!
    if Abs(dx!)<Abs(dy!)
        Return Pi()/2-ArcTan(dx!/dy!)+If((dx!<0) | (dy!<0),Pi(),0)
    else
        Return ArcTan(dy!/dx!)+If((dx!<0) | (dy!<0),Pi(),0)
    endif
/../../function-references/XProfan/endproc/'>endproc
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Jac
 de
 Lad
 | | je hab un l'an Vorarbeit par Parcival, là erwarte je, dass mon Formel besser ist!  | 
 | 
|  | 
|  | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
 | 05.12.2006  ▲ | 
 | 
|  | 
| 
 
 
 | 
|  | 
|  | | bien sûr mais elle va pas.  | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Jac
 de
 Lad
 | | Hab qui change dans Dezimalgrad oublier qc: KompilierenMarqueSéparation
 
proc Winkel
    Parameters x1!,y1!,x2!,y2!
    declare dx!,dy!
    dx!=x2!-x1!
    dy!=y2!-y1!
    if Abs(dx!)<Abs(dy!)
        Return (Pi()/2-ArcTan(dx!/dy!)+If((dx!<0) | (dy!<0),Pi(),0))/Pi()*180
    else
        Return (ArcTan(dy!/dx!)+If((dx!<0) | (dy!<0),Pi(),0))/Pi()*180
    endif
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
 | 05.12.2006  ▲ |  | 
 | 
|  | 
| 
 
 
 | 
|  | 
|  | | Alles bien sûr je exposition...  | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  | | Jain: exposition selbst: KompilierenMarqueSéparation
  {$cleq}
const myPi=3.1415926535897932384626433832795
cls
while 1
    cls
    print int(wnk(100,100,mousex,mousey,false)),"°  "
    print winkel(100,100,mousex,mousey),"°"
    sleep 50
wend
waitkey
proc wnk(float x1,y1,x2,y2,int mode)
    float x= sub ( x2! , x1! )
    float y= sub ( y2! , y1! )
    line x1,y1 - x2,y2
    case (x<0) and (y<0) : return wnk(x2,y2,x1,y1,3)
    case x<0 : return wnk(x2,y1,x1,y2,1)
    case y<0 : return wnk(x1,y2,x2,y1,2)
    casenot x : x=0.0000001
    casenot y : y=0.0000001
    float w=arctan(y/x)*57.295779513082320876798154814105
    if (mode==1)
        w:=90+(90-w)
    elseif (mode==2)
        w:=360-w
    elseif (mode==3)
        w:=180+w
    endif
    return w
endproc
proc Winkel
    Parameters x1!,y1!,x2!,y2!
    declare dx!,dy!
    dx!=x2!-x1!
    dy!=y2!-y1!
    if Abs(dx!)<Abs(dy!)
        Return (Pi()/2-ArcTan(dx!/dy!)+If((dx!<0) | (dy!<0),Pi(),0))/Pi()*180
    else
        Return (ArcTan(dy!/dx!)+If((dx!<0) | (dy!<0),Pi(),0))/Pi()*180
    endif
/../../function-references/XProfan/endproc/'>endproc
si xx<x et y<yy scheiterts.
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  | | alors ähäm cela isses oui grad je muss qui souris KreisRum tirer peut et toujours cela richtige Value conservé. Votre Funktion ist sûrement vraie besser si vous maintenant encore cela selbe result comment mon ausspuckt.  | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 | 
|  | 
|  Jac
 de
 Lad
 | | pourquoi muss unbeding 270° dessus son? Unten wärs viel einfacher! | 
 | 
|  | 
|  | | Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
 | 05.12.2006  ▲ | 
 | 
|  | 
| 
 
 
 |