|  |  | 
|  | 
|  | 
|  p.specht
 
 
  | | 
 WindowTitle "Vektorfeld zum Mauszeiger":windowStyle 24:Window 0,0-%maxx,%maxy-40
var xx&=width(%hwnd):var yy&=height(%hwnd):var xh&=xx&*0.5:var yh&=yy&*0.5:var ende&=0
proc ArcTan4 :parameters x!,y!:var pi!=3.1415926535897932:var w!=0'(CL)2014-01 P.Specht
    if x!=0:if y!>0:w!=pi!*0.5:elseif y!<0:w!=pi!*1.5:else :w!=0:endif :return w!:elseif x!>0
        if y!=0:w!=0:return w!:elseif y!>0:if x!>y!:w!=arctan(y!/x!):else :w!=pi!/2-arctan(x!/y!):endif
            return w!:else :if x!<-y!:w!=pi!*1.5+arctan(x!/-y!):else :w!=2*pi!-arctan(-y!/x!):endif :return w!
            endif :else :if y!>0:if x!>-y!:w!=pi!/2+arctan(-x!/y!):return w!:else :w!=pi!-arctan(y!/-x!)
            return w!:endif :elseif y!<0:if x!<y!:w!=pi!+arctan(-y!/-x!):else :w!=pi!*1.5-arctan(-x!/-y!)
            endif :return w!:else :w!=pi!:return w!:endif :endif :Print " ArcTan4 ERROR":waitinput:waitinput
        endproc
        declare i&,j&,k&,w!,L!,LL! : L!=40 : LL!=L!*0.9
        Repeat
            MCLS xx&,yy&,$FFFFFF : startpaint -1
            WhileLoop 36:i&=LL!*&Loop:WhileLoop 18:j&=LL!*&Loop
                usepen 0,7,255:line i&,j& - i&+1,j&
                w!=arctan4(%mousex-i&,%mousey-j&)
                usepen 0,2,0:line i&,j& - i&+L!*cos(w!),j&-L!*sin(-w!)
                endwhile :endwhile : EndPaint
                MCopyBMP 0,0 - xx&,yy& > 0,0;0
            Until ende&
 | 
 | 
|  | 
|  | | XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 14.05.2021  ▲ | 
 | 
|  | 
| 
 
 
 |