use "plot"
plot x-2You can use these following operator
| Operator | Function | Example |
|---|---|---|
+ |
Addition | plot x+3 |
- |
Subtraction | plot x-3 |
* |
Multiplication | plot 3*x |
/ |
Division | plot x/3 |
^ |
Involution | plot x^2 |
% |
Surplus | plot x%3 |
You can use these following command to operate mathematically.Actionscript3.0 Math Class
| Method | Function | Example |
|---|---|---|
pow |
Computes and returns val1 to the power of val2. | plot pow(x, 2) |
log |
Returns the natural logarithm of the parameter val. | plot log(10) |
sin, cos, tan |
Trigonometric | plot cos(x) |
sqrt |
Computes and returns the square root of the specified number. | plot sqrt(4) |
PI |
A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793. | plot PI |
E |
A mathematical constant for the base of natural logarithms, expressed as e. | plot E |
You can plot between varying area, when you define the scope.
plot [-5:10] 0.1*x^2tをラジアンとしてxの式とyの式を指定してあげることで円などの様々な曲線を描画できます。いろいろ試してみてぜひグラフを保存してみてください。
plot x=cos(t), y=sin(t)use "draw" command
draw line({x:0, y:0}, {x:5, y:5})It is possible to draw on the graph in figures of the straight line, the triangle, the quadrangle, and yen, etc. by specifying coordinates.
| Method | Function | Example |
|---|---|---|
line |
It draws in the straight line specifying two points. | draw line({x:0, y:0}, {x:5, y:5}) |
triangle |
It draws in the triangle specifying three points. | draw triangle({x:0, y:0}, {x:3, y:0}, {x:0, y:3}) |
rectangle |
draw rectangle | draw rectangle({x:0, y:0, w:3, h:3}) |
circle |
draw circle | draw circle({x:0, y:0}, 3) |
point |
draw point | draw point({x:1, y:1}) |
use "move" command
move(1, {x:1, y:1})The range where x changes is definable specifying it.
set xrange = [-5:10]The range of y axis can be specified.
set yrange = [-5:10]The title can be set to the made graph.
set title = 2次関数のグラフ