Jump to content

Quadradic Formulae and Clock


themax90
 Share

Recommended Posts

Here is a quadradic answer calculator. Input the undefined numbers and it will retrieve the answers. I think I did quadradic formulae in middle school algebra. Hope it's helpful.

Func QuadCalc($a, $b, $c)
    Dim $calc[2], $final[2]
;Creates Array Varibles For Process
    $calc[0] = (-1) * ($b)
    $calc[1] = ($b * $b) - (4 * $a * $c)
;First Two Base Commands
    If $calc[1] < 0 Then
    ;Before SqRt is calculated check varible. If negitive send impossible
        MsgBox(0, "Quad Answers", "This problem is impossible because the Square Root became a negitive integer.")
    ElseIf $calc[1] >= 0 Then
    ;If non-negitive, calculate further equation and send
        $calc[1] = Sqrt($calc[1])
        $final[0] = ($calc[0] + $calc[1]) / (2 * $a)
        $final[1] = ($calc[0] - $calc[1]) / (2 * $a)
        MsgBox(0, "Quad Answers", "The answers are: " & $final[0] & ", " & $final[1])
    EndIf
EndFunc

Also Heres a clock

Global $sec = @SEC, $minute, $hour, $light, $time, $clocklabel
opt("WinWaitDelay", 100)
opt("WinTitleMatchMode", 4)
opt("WinDetectHiddenText", 1)
opt("MouseCoordMode", 0)
GUICreate("Max's Clock", 200, 50, (@DesktopWidth - 188) / 2, (@DesktopHeight - 59) / 2)
$clocklabel = GUICtrlCreateLabel("Loading...", 5, 5, 190, 40, 0x1000)
GUICtrlSetFont($clocklabel, 24)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then
        ExitLoop
    ElseIf $sec <> @SEC Then
        GUICtrlSetData($clocklabel, TimeSet())
        AlarmCheck(TimeSet())
    EndIf
WEnd
Exit
Func AlarmCheck($time)
If $time = "08:00:00 AM"; 8 Am
;Alarm function(configure how wanted)
EndIf
EndFunc  ;==>AlarmCheck
Func TimeSet()
    $light = " AM"
    $hour = @HOUR
    $minute = @MIN
    $sec = @SEC
    If $hour = 0 Then
        $hour = 12
    ElseIf $hour = 12 Then
        $light = " PM"
    ElseIf $hour > 12 Then
        $hour = (@HOUR) - 12
        $light = " PM"
    EndIf
    $time = $hour & ":" & $minute & ":" & $sec & $light
    Return $time
EndFunc  ;==>TimeSet

Enjoy

AutoIt Smith

Link to comment
Share on other sites

  • 1 month later...
Guest giggsey

I would be very interested in this program with the graphs, I just did these in school, and they are annoying.

I can't code much for this yet

Link to comment
Share on other sites

Finding the 0's of those equations (where they cross the x-axis i believe), the min/max of the parabolas, etc

If you do graphics, don't forget to make sure it works with rotation functions :) (Always are a slight pain)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...