Before anyone Says Anythink, I was Bored and had nothing to do...
I Think there all Right, But To be honist, I havant exactly thought of how to test functions like [ChangeInGravitationalPotential()], Unless I had a Planit Spare
` Random Mathmatical Calculations
`
` Coded By Michael Mihalyfi
` MSon648@Hotmail.com
Do
Cls
Text 10,10,Str$(rMouseX()) + " - " + Str$(rMouseY())
Sync
Loop
Function rMouseX()
Rv = Differance(Screen Width(),MouseX())
EndFunction Rv
Function rMouseY()
Rv = Differance(Screen Height(),MouseY())
EndFunction Rv
Function ValueWrap(Min#,Value#,Max#)
If Value# <= Min# Then ExitFunction Min#
If Value# => Max# Then ExitFunction Max#
EndFunction Value#
Function Differance(Value1#,Value2#)
Rv# = Abs(Value1#) - Abs(Value2#)
EndFunction Rv#
Function Average(Value1#,Value2#)
Rv# = Smallest(Value1#,Value2#) + (Differance(Value1#,Value2#) / 2)
EndFunction Rv#
Function Smallest(Value1#,Value2#)
If Value1# < Value2# Then ExitFunction Value1#
EndFunction Value2#
Function Largest(Value1#,Value2#)
If Value1# > Value2# Then ExitFunction Value1#
EndFunction Value2#
Function Negotive(Value#)
If Value# <= 0 Then ExitFunction Value#
Dec Value,Value * -2
EndFunction Value#
Function Opposite(Value#)
If Value# < 0 Then Rv# = Abs(Value#)
If Value# > 0 Then Rv# = Negotive(Value#)
EndFunction Rv#
Function Perscent(Value#,Max#)
Rv# = Max# / 100 * Value#
EndFunction Rv#
Function RoundUp(Value#,Nearest#)
Repeat
Inc LoopValue#,Nearest#
If Value# > LoopValue# And < Nearest# + LoopValoe# Then Rv# = Nearest# + LoopValoe#
Until Rv# <> 0
EndFunction Rv#
Function RoundDown(Value#,Nearest#)
Repeat
Inc LoopValue#,Nearest#
If Value# > LoopValue# And < Nearest# + LoopValoe# Then Rv# = LoopValoe#
Until Rv# <> 0
EndFunction Rv#
Function Dist1D(x1#,x2#)
Rv# = (Abs(x1#) - Abs(x2#))
EndFunction Rv#
Function Dist2D(x1#,y1#,x2#,y2#)
Rv# = (Abs(x1#) - Abs(x2#)) + (Abs(y1#) - Abs(y2#))
EndFunction Rv#
Function Dist3D(x1#,y1#,z1#,x2#,y2#,z2#)
Rv# = (Abs(x1#) - Abs(x2#)) + (Abs(y1#) - Abs(y2#)) + (Abs(z1#) - Abs(z2#))
EndFunction Rv#
Function Pi()
EndFunction 3.143
Function Sucumfrance(Radius#)
Rv# = Radius * Pi()
EndFunction Rv#
Function RadiusFromCucumfrance(C#)
Rv# = C# / Pi()
EndFunction Rv#
Function SucumfranceOfSphere(xRadius#,yRadius#)
Rv# = Sucumfrance(xRadius#) * Sucumfrance(yRadius#)
EndFunction Rv#
Function ObjectSpheresSucumfrance(On)
Rv# = ObjectSpheresxRidius(On) * Pi() * (Average(ObjectSpheresyRidius(On),ObjectSphereszRidius(On)) * Pi())
EndFunction Rv#
Function ObjectSpheresxRidius(On)
Rv# = Object Size X(On) / 2
EndFunction Rv#
Function ObjectSpheresyRidius(On)
Rv# = Object Size X(On) / 2
EndFunction Rv#
Function ObjectSphereszRidius(On)
Rv# = Object Size X(On) / 2
EndFunction Rv#
Function ObjectsMass(On,Scale#)
` Standard Scale# = 1
ObjectsMass# = Mass(Object Size X(On),Object Size Y(On),Object Size Z(On)) * Scale#
EndFunction ObjectsMass#
Function Mass(xSize#,ySize#,zSize#)
Mass# = xSize# * ySize# * zSize#
EndFunction Mass#
Function Speed(Distance#,TimeTaken#)
Speed# = Distance# / TimeTaken#
EndFunction Speed#
Function Force(Mass#,Acceleration#)
Force# = Mass# * Acceleration#
EndFunction Force#
Function Acceleration(ChangeInVelocity#,TimeTaken#)
Acceleration# = ChangeInVelocity# / TimeTaken#
EndFunction Acceleration#
Function Density(Mass#,Volume#)
Density# = Mass# / Volume#
EndFunction Density#
Function Momentum(Mass#,Velocity#)
Momentum# = Mass# * Velocity#
EndFunction Momentum#
Function Weight(Mass#,GravitationalFieldStrenth#)
Weight# = Mass# * GravitationalFieldStrenth#
EndFunction Weight#
Function KineticEnergy(Mass#,Speed#)
KineticEnergy# = 0.5 * Mass# * (Speed#^2)
EndFunction KineticEnergy#
Function ChangeInGravitationalPotential(Mass#,GravitationalFieldStrenth#,ChangeInHeight#)
ChangeInGravitationalPotential# = Mass# * GravitationalFieldStrenth# * ChangeInHeight#
EndFunction ChangeInGravitationalPotential#
Function Pressure(Force#,Area#)
Pressure# = Force# / Area#
EndFunction Pressure#
Function Charge(Current#,Time#)
Charge# = Current# * Time#
EndFunction Charge#
Function PotentialDifferance(Current#,Resistance#)
PotentialDifferance# = Current# * Resistance#
EndFunction PotentialDifferance#
Function ElectricalPower(PotentialDifferance#,Current#)
ElectricalPower# = PotentialDifferance# * Current#
EndFunction ElectricalPower#
Function WaveSpeed(Frequency#,WaveLenth#)
WaveSpeed# = Frequency# * WaveLenth#
EndFunction WaveSpeed#
Function CentripetalForce(Mass#,Speed#,Radius#)
CentripetalForce# = Mass# * (Speed#^2) / Radius#
EndFunction CentripetalForce#
Function Capacitance(ChargeStored#,Voltage#)
Capacitance# = ChargeStored# / Voltage#
EndFunction Capacitance#
Function MeaningOfLife
EndFunction 42