sterlinghost.blogg.se

Zoom math 500 guide
Zoom math 500 guide




  1. ZOOM MATH 500 GUIDE CODE
  2. ZOOM MATH 500 GUIDE FREE

We can improve our work even more! :) Let's add the possibility to resize the plot.

ZOOM MATH 500 GUIDE FREE

A very good one is Parser10 which is free (even if a bit old it's very good in our case) or tbcParser. Well, we need a parser to parse the function. What if we want this to be more flexible? For example: get the function x^2 - 2x + 3 from a TEdit and click a button to show the function. The "problem" is that we have to hard-code the function and assing a value to logy at compile time.

ZOOM MATH 500 GUIDE CODE

The code has logx and logy that allow us to do a scaling and plot the function. What if we want to plot x^2 - 2? Very easy! Just use the code above and replace this line: logy := logx*logx - 2 (x*x - 2 x^2 - 2). For example: we wanted to plot x^2 - 2*x - 1 and so we have written logx*logx - 2*logx - 1. Use the logy to define your function and use logx as variable. The second part is the same but note that I am using a dark thick stroke. In the first part we calculate the space between the lines of the grid and the in a for loop I draw the lines. The procedure DrawAxes is very important just click on the Rectangle1 and put the procedure inside its OnPaint event. Procedure TForm1.Rectangle1Paint(Sender: TObject Canvas: TCanvas

zoom math 500 guide

Procedure TForm1.DrawAxes(aCanvas: TCanvas) Ī := TAlphaColorRec.Silver ĪCanvas.DrawLine(TPointF.Create(pw, 0), TPointF.Create(pw, Rectangle1.Height), 1) ĪCanvas.DrawLine(TPointF.Create(0, ph), TPointF.Create(Rectangle1.Width, ph), 1) Ī := TAlphaColorRec.Black ĪCanvas.DrawLine(TPointF.Create((w/2), 0), TPointF.Create((w/2), h), 1) ĪCanvas.DrawLine(TPointF.Create(0, (h/2)), TPointF.Create(w, (h/2)), 1) Procedure TForm1.FormCreate(Sender: TObject) Add the following code above the declaration of your form. Drop a TRectangle and align it to client in the object inspector on the left expand the Fill property and change the Color to white. I'll create an example with a new Firemonkey HD From (File > New > Multi-Device Application). It is not needed but without this you'll have to hard code the function every time. It is optional that you have a function parser (Parser10 or tbcParser) to parse a function.I am going to use the latter but it's your choice, the important thing is that you can use the OnPaint event. It can be what you prefer, for example a TPanel or a TRectangle. Create a new project and drop a container.I have seen many times people asking for a working solution about the function plot and now I am showing you a very easy step-by-step guide! :) First of all I need to say that this method is able to plot any kind of function f(x) for example f(x) = x^2 - 2x - 1.






Zoom math 500 guide