![]() ![]() It is easy to see that this sprintf returns the definition of an arrow between new_x, f(new_x), and x3, f(x3). In the last line, we concatenate a string called ARROW, and another one, produced by another sprintf. When adding to PLOT, we simply use the sprintf function. In the next step, based on the 6 input arguments, calculates the three parameters of our parabola, and in the next line, adds the plot of this parabola to a string called PLOT. Then, it defines new_x, which we have already seen in the first example. PLOT = PLOT.sprintf(", cut(x,%f,%f)*(%f*x*x %f*x %f) with lines lt -1", x1, x3, a, b, c), \ĪRROW.sprintf("set arrow from %f, %f to %f,%f as 1 ", new_x, a*new_x*new_x b*new_x c, x3, 圓))Īnd try to understand what it does! For a start, it takes 6 arguments, which are nothing but the coordinates of the end points, and the control point. What we will do is to define a "function" that sets our arrows, and, as the supplementary instruction, augments the plot command accordingly. Set style arrow 1 head filled size screen 0.03, 15, 45 lt -1Ĭut(x,x1,x3) = ((x >= x1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |