Jump to content

Graphic Formula control


jvanegmond
 Share

Recommended Posts

Thanks to imbatmo for the idea with his Plotting Tool

I was bored, and decided to recreate this UDF style. Here is a example, and I have added the UDF (Graph.au3) as an attachment.There's a few bugs now, but I really don't feel like bug-fixing, so go ahead and pick this up.

#include <GUIConstants.au3>
#include <Graph.au3>

$pi = 3.1415926535897932384626433832795

GUICreate("Manadar's Plotting Example",400,400)

$Plot = _GraphCreate(5,5,390,390)
_GraphDrawBackground($Plot)

_GraphSetBound($Plot, -2,2,-2*$pi,2*$pi) ; Boundaries are bugged if you take a positive value as minimum bound, or when you don't take -n as minimum and +n as maximum.

$Formula1 = _GraphCreateFormula($Plot,"Sin(x)")
$Formula2 = _GraphCreateFormula($Plot,"Cos(x)")
$Formula3 = _GraphCreateFormula($Plot,"Tan(x)")

GUISetState()

_GraphDrawFormula($Plot,$Formula1,50) ; Draws the formula with a delay of 50 ms between each pixel. Normal speed imo.
_GraphDrawFormula($Plot,$Formula2,25) ; Draws the formula twice as fast as the last one.
_GraphDrawFormula($Plot,$Formula3) ; Draws the formula instantly.

;_GraphClear($Plot) ;_GraphClear is bugged because it doesn't make a white background.


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSe
            Exit
    EndSwitch
WEnd

Graph.au3

Edited by Manadar
Link to comment
Share on other sites

  • 2 weeks later...

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...