English
Experimente

Planetenbahn-Simulation with integrally brauchbarer 4-quadrants-ArcTan-function

 

p.specht

Voreingestellt: an demonstration, wieso Merkur its Periheldrehung power and not of/ one stabilen Kepler-ellipsis runs. others functions serve to that rumspielen
Window Title "Trashware: Planetenbahnsimulation to that 'rumspielen"
'(CL)CopyLeft 2014-01 by P.woodpecker, Wien
Window 0,0-%maxx,%maxy-40:randomize:set("decimals",5):set("numwidth",9)
Font 2:var xx&=width(%hwnd)\2:var yy&=height(%hwnd)\2
var strain!=0.0174532925199432958:var wheel!=57.2957795130823209
'=========================================================================
'    Experimentierfeld
'-------------------------------------------------------------------------
var G!=10^-17 : var m1!=10^20 : var v2!= 1'Periheldrehungen the Merkur
'var G!=10^-17 : var m1!=10^20 :var v2!= 2.2 ' Kreisbahn
'var G!=10^-15 : var m1!=10^20 :var v2!= 2.2 ' More Gravitation?
'var G!=5*10^-18 : var m1!=10^20 :var v2!= 2 ' Pluto
'var G!=10^-15 : var m1!=10^30 :var v2!= 2.2 '
'=========================================================================
'var x2!=100:var y2!=0 ' Einschuss-Bahnpunkt
'     var w2!=90*strain! ' Einschusswinkel
var x2!=100:var y2!=0:var w2!=90*strain!
'=========================================================================
declare a2!,rr!,alpha!:declare a2x!,a2y!,v2x!,v2y!:declare n&
cls $cdcdcd:line 20,yy& - 2*xx&-20,yy&:line xx&,20 - xx&,2*yy&-20

repeat

    locate 1,1:'print n&,::inc n&
    print x2!,y2!,v2!,w2!*wheel!;:usepen 1,22,rgb(255,255,0):line xx&,(yy&) - xx&+1,yy&
    usepen 0,12,rnd(8^8):line xx&+x2!,(yy&-y2!) - xx&+1+x2!,yy&-y2!
    alpha!=ArcTan4(x2!,y2!)
    rr!=sqr(x2!)+sqr(y2!):case rr!<10000:rr!=10000
    a2!= -G!*m1!/rr!
    v2x!=v2!*cos(w2!)+a2!*cos(alpha!)/2
    v2y!=v2!*sin(w2!)+a2!*sin(alpha!)/2
    w2!=ArcTan4(v2x!,v2y!)
    x2!=x2!+v2x!
    y2!=y2!+v2y!
    v2!=sqrt(sqr(v2x!)+sqr(v2y!))'*1.001
    waitinput 1:until %key=27:end

    proc ArcTan4 :parameters x!,y!

        var pi!=3.1415926535897932:var w!=0'(CL)2014-01 P.woodpecker§gmx.at

        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

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/07/21  
 



Zum Experiment


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

404 Views

Untitledvor 0 min.
Sven Bader08/11/21
p.specht08/11/21
Ernst07/21/21
Uwe ''Pascal'' Niemeier06/13/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


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