English
Source / code snippets

to charge line maths Winkel

 
maths Winkel from line to charge
CompileMarkSeparation
proc wnk(float x1,y1,x2,y2,int mode)

    float dx=x2!-x1!
    float dy=y2!-y1!
    case (dx<0) and (dy<0) : return wnk(x2,y2,x1,y1,3)
    case dx<0 : return wnk(x2,y1,x1,y2,1)
    case dy<0 : return wnk(x1,y2,x2,y1,2)
    casenot dx : dx=0.0000001
    casenot dy : dy=0.0000001
    float w=arctan(dy/dx)*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

 
12/05/06  
 



and here another alternative and better function of Hubert Binnewies:
CompileMarkSeparation
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!

/../funcion-referencias/XProfan/endproc/'>endproc

 
12/06/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.682 Views

Untitledvor 0 min.
iF05/07/16
funkheld10/06/15
Peter Max Müller05/29/15
Heiko Dix12/09/10

Themeninformationen

this Topic has 1 subscriber:

iF (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie