English
Includes

maths slight made - INCLUDE with leichtem code.

 
- Page 1 -



Gary12345
Hi,

I have a Include based on leichtem XPROFAN code prepares.

Download

functions from the code ablesbar!

10 kB
Hochgeladen:02/01/13
Downloadcounter262
Download
 
MfG
Gary12345
01/27/13  
 



 
- Page 3 -



Julian
Schmidt
what in the Context of Quadratischen functions yet interestingly would, is the Berechnung the Scheitelpunktes.
Diesen can you over The Quadratische appendix or over the story the Nullstellen and anschließenden einsetzten for X calculate.
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/29/13  
 




Gary12345
there are we straight in the Matheunterricht

sooner not. I have a plan, I einbaue and the I will first durchnehmen, what then becomes, white I not yet eindeutig.
 
XProfan X2
MfG
Gary12345
01/29/13  
 




Gary12345
Hi,

derzeitiger code:
CompileMarkSeparation
'Include programmiert von Gary12345

Proc Summe

    parameters a!,b!
    declare Summe!
    set("decimals",2)
    Summe! = a!+b!
    return ROUND(Summe!,2)

EndProc

Proc Info'Muss noch weiter ausgebaut werden!

    print "Summe: Addiert zwei Zahlen. Summe(a,b). Es werden a und b miteinander addiert.a+b=Ergebnis"
    print ""
    print "Minus: Subtrahiert zwei Zahlen. Minus(a,b). Es werden a und b miteinander subtrahiert.a-b=Ergebnis"
    print ""
    print "Teilen: Teilt zwei Zahlen. Fehler bei Divison durch 0. Teilen(a,b). a wird durch b geteil.a:b=Ergebnis"
    print ""
    print "Multiplizieren: Multipliziert zwei Zahlen. Multiplizieren(a,b). Es werden a und b miteinander multipliziert.a*b=Ergebnis"
    print ""

EndProc

Proc Minus

    parameters a!,b!
    declare Minus!
    set("decimals",2)
    Minus! = a!-b!
    return ROUND(Minus!,2)

EndProc

Proc Teilen

    parameters a!,b!
    declare Teilen!
    set("decimals",2)
    Teilen! = a!/b!
    return ROUND(Teilen!,2)

EndProc

Proc Multiplizieren

    parameters a!,b!
    declare multiplizieren!
    set("decimals",2)
    multiplizieren! = a!*b!
    return ROUND(Multiplizieren!,2)

EndProc

Proc Wurzel

    parameters a!
    declare Wurzel!
    set("decimals",2)
    Wurzel! = sqrt(a!)
    return Round(Wurzel!,2)

EndProc

Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)
    ADreieck! = 0.5*a!*b!
    return ROUND(ADreieck!,2)

EndProc

Proc AQuadrat

    parameters a!
    declare Quadrat!
    set("decimals",2)
    Quadrat!=a!*a!
    return ROUND(Quadrat!,2)

EndProc

Proc ARechteck

    parameters a!,b!
    declare Rechteck!
    set("decimals",2)
    Rechteck! = a!*b!
    return ROUND(Rechteck!,2)

EndProc

Proc AKreis

    parameters a!
    declare Kreis!
    set("decimals",2)
    Kreis! = @Pi()*a!
    return ROUND(Kreis!,2)

EndProc

Proc ATrapez

    parameters a!,c!,h!'Trapezformel: 0.5*(a+c)*höhe! (h!)
    declare Trapez!
    set("decimals",2)
    Trapez! = 0.5*(a!+c!)*h!
    return ROUND(Trapez!,2)

EndProc

Proc AParallelogramm

    parameters g!,h!
    declare Parallelogramm!
    set("decimals",2)
    Parallelogramm! = g!*h!'Grundfläche*Höhe
    return ROUND(Parallelogramm!,2)

EndProc

Proc VWürfel

    Parameters a!
    declare Würfel!
    set("decimals",2)
    Würfel! = a!*a!*a!
    return ROUND(Würfel!,2)

EndProc

Proc VQuader

    Parameters a!,b!,c!
    declare Quader!
    set("decimals",2)
    Quader! = a!*b!*c!
    return ROUND(Quader!,2)

EndProc

Proc VKugel

    parameters r!
    declare Kugel!
    set("decimals",2)
    Kugel! = 4/3*@PI()*r!*r!*r!
    return ROUND(Kugel!,2)

EndProc

Proc VKegel

    parameters r!,h!
    declare Kegel!
    set("decimals",2)
    Kegel! = 1/3*@PI()*r!*r!*h!
    return ROUND(Kegel!,2)

EndProc

Proc Lösungsformel1'Wert bei -b-...

    parameters a!,b!,c!
    set("decimals",2)
    var Lösungsformel1! = -((b!/a!)/2)+sqrt(abs(((b!/a!)/2)^2-(c!/a!)))
    var Lösungsformel2! = -((b!/a!)/2)-sqrt(abs(((b!/a!)/2)^2-(c!/a!)))
    return Str$(ROUND(Lösungsformel1!,2))+" | "+Str$(ROUND(Lösungsformel2!,2))

EndProc

Proc Höhensatz

    parameters p!,q!
    declare Höhensatz!
    set("decimals",2)
    Höhensatz! = p!*q!'p*q=h²
    return ROUND(sqrt(Höhensatz!),2)

EndProc

Proc Hypothenusensatz

    parameters a!,b!
    declare c!
    set("decimals",2)
    c!=b!*b!+a!*a!
    return ROUND(sqrt(c!),2)

EndProc

Proc Kathetensatz1

    parameters p!,c!
    declare b!
    set("decimals",2)
    b!=c!*p!
    return ROUND(sqrt(b!),2)

EndProc

Proc Kathetensatz2

    parameters q!,c!
    declare a!
    set("decimals",2)
    a!=c!*q!
    return ROUND(sqrt(a!),2)

EndProc

Proc VPrisma

    parameters g!,h!
    declare v!
    set("decimals",2)
    v! = g!*h!'Grundfläche*Höhe!
    return ROUND(v!,2)

EndProc

Proc VZylinder

    parameters r!,h!
    declare v!
    set("decimals",2)
    v! = @pi()*r!*r!*h!
    return ROUND(v!,2)

EndProc

cls
var test1! = Lösungsformel1(2,3,-4)
var test2! = Höhensatz(6,7)'p*q=h²
var test3! = Hypothenusensatz(2,3)
var test4! = Kathetensatz1(4,2)
var test5! = Kathetensatz2(4,2)
var test6! = VPrisma(2,4)
var test7! = VZylinder(2,3)
print test1!
print test2!
print sqrt(42)
print test3!
print sqrt(13)
print test4!
print sqrt(8)
p
a> Test5! print Test6! print Test7! WaitInput

OK-have now any functions installed, The I gladly having would like (shining too To functions).


a globale Fehlervariable How mErr& To use.


what's this thing? in the Help find I nothing?

LG
 
XProfan X2
MfG
Gary12345
01/29/13  
 




Julian
Schmidt
simply a globale Variable in the You any ? Happen? To Fehlern save.
integrally supra simply by declare mErr&  deklarieren.

into routines then The Error in these new Variable write. has the benefit that you integrally simply to whom Perform and on eachone place the Program to check on can, whether The latest mathematical operation successful was. because it often or. always with one Error none makes sense try moreover To calculate. The Variable in eachone routine first on Standart zurücksetzen!
CompileMarkSeparation
declare mErr&
print Wurzel(-1)

If mErr&=1

    print "Negative Wurzel"

Else

    print "keine Fehler"

EndIf

waitinput

Proc Wurzel

    parameters a!
    clear mErr&
    declare Wurzel!
    set("decimals",2)
    case a!<0 : mErr&=1'Flag für eine negative Wurzel
    Wurzel! = sqrt(abs(a!))
    return Round(Wurzel!,2)

ENDPROC

 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/29/13  
 




Julian
Schmidt
time a couple small suggestions and Tipps To your Include.

1. can you your whole Texts from the Info-routine directly in The concerned routine as comment write. comments go simply with ' or // began.
2. should in a gutem Matheinclude The Funktionsnamen too to whom right mathematischen Begriffen benannt his. about instead of sharing, divide. under Umständen should even The Parameter others benannt go. in the routine "Teilen" in example Dividende and Divisor. thereby ought to one but weigh whether the code therefore badly readable and is therefore evtl. to gängigen Abkürzungen search.
3. with volume of Körpern is the Öberfläche not far.
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/29/13  
 




Gary12345
no trouble, becomes everything made.

only a problem to the others trouble

I versteh not Why "If mErr& = 1". Why = 1? i will still inquire, whether negatives values present are?

what about me should then useful everywhere The Fehlervariable with clear in all Procs deklarieren?

LG
 
XProfan X2
MfG
Gary12345
01/30/13  
 




Julian
Schmidt
gary12345 (30.01.13)

I versteh not Why "If mErr& = 1". Why = 1? i will still inquire, whether negatives values present are?


The worth 1 is more or less willkürlich.
with the row
CompileMarkSeparation
case a!<0 : mErr&=1
>
examine You, whether the worth in the root negative is, and if so becomes The Fehlervariable mErr& same 1 staid.
You could means just as
CompileMarkSeparation
If a!<0

    mErr&=1

Endi
write.
whom worth one have I as Flag for Error negatives root chosen. You could for others Error in the Procedur yet others ? Happen? give away. Z.B. if the case Division through zero vorkommt, for this mErr&=2. No Error would here mErr&=0.
now can You by IF simply inquire whether no Error (mErr&=0), one Error (mErr&<>0), or. which Error aufgetreten is (mErr&=1 or mErr&=2)

gary12345 (30.01.13)

what about me should then useful everywhere The Fehlervariable with clear in all Procs deklarieren?


The Variable is with Clear not declared, separate reset. can also simply mErr& = 0 write. is necessary, there at erfolgreichen Durchlaufen (without Error) otherwise teh folks Error values stand stayed
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/30/13  
 




Gary12345

CompileMarkSeparation
Proc Teilen

    parameters a!,b!
    clear mErr&
    declare Teilen!
    set("decimals",2)
    Teilen! = a!/b!
    return ROUND(Teilen!,2)

    If b! = 0

        mErr& = 1

    EndIf

    If mErr&=1

        print "Division durch 0!"

    EndIf

ENDPROC


then ought to this but weg? but it comes before it still The Fehlermelung. with Clear have I The Variable Yes reset...

Thank you!
 
XProfan X2
MfG
Gary12345
01/30/13  
 




Julian
Schmidt
there have you got The incorrect Order. You must first whom Error with If-inquire and if one Error appears from the function jumping z.B. with return. The Error Message comes always with a Math-Error and then stützt the program ex.
Probier at next time simply with Einzelschritt-mode on The Solution To come. lead You simply by Traceon at the beginning the routine\Program from and closes You again by Traceoff
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/30/13  
 




Gary12345

CompileMarkSeparation
Proc Teilen

    parameters a!,b!
    clear mErr&
    declare Teilen!
    set("decimals",2)

    If b! = 0

        mErr& = 1

    EndIf

    If mErr&=1

        print "Division durch 0!"
        return

    EndIf

    Teilen! = a!/b!
    ROUND(Teilen!,2)

ENDPROC


means so is correct the then?
 
XProfan X2
MfG
Gary12345
01/30/13  
 




Gary12345
No so comes of course the right Result out, but so is it eleganter:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)

    If a! or b!>0

        mErr&=3

    EndIf

    If mErr&=3

        print "Unlogisches Ergebnis, da - Flächeninhalt!"
        return

    Else

        ADreieck! = 0.5*a!*b!
        return ROUND(ADreieck!,2)

    EndIf

ENDPROC


Have I right?
 
MfG
Gary12345
01/30/13  
 




Julian
Schmidt
No i'd say sooner so
CompileMarkSeparation
Proc Teilen

    parameters a!,b!
    clear mErr&
    declare Teilen!
    set("decimals",2)

    If b! = 0

        mErr& = 1
        Return -1

    EndIf

    Teilen! = a!/b!
    ROUND(Teilen!,2)

EndProc

Proc ADreieck

    parameters a!,b!
    clear mErr&
    declare ADreieck!
    set("decimals",2)

    If (a!>0) or (b!>0)

        mErr&=3
        Return -1

    EndIf

    ADreieck! = 0.5*a!*b!
    return ROUND(ADreieck!,2)

ENDPROC


On take off a Error want You with ADreieck Verify? with the Multiplikation there really no Math-Errors.
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01/30/13  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

51.223 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
XProfan Newbie02/18/23
rafl06/21/22
Member 229993110/21/19
More...

Themeninformationen



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