The position (or rather the start and the end position) of
a point can be specified by the coordinates option:
"coordinates" => [[$xstart,$ystart],[$xend,$yend]]
For example,
the command
point({"type" => "ccirc",
"coordinates" => [[-100,-50],[30,20]]});
will draw a solid circle (a "bullet", if you wish)
that moves from (-100,-50) to (30,20) along a straight
line in a uniform motion. |
The most general way to define coordinates though is to add the
"polar" option:
"coordinates" => [[$xstart,$ystart],[$xend,$yend]]
"polar" => [[$rstart,$phistart],[$rend,$phiend]]
where $phistart,$phiend is to be given in degrees.
The start and end coordinates will then be
($xstart,$ystart) + $rstart*(cos($phistart),sin($phistart))
($xend,$yend) + $rend*(cos($phiend),sin($phiend))
This makes it easy to move a point on a spiral, for example:
point({"type" => "ccirc",
"coordinates" => [[-100,-50],[30,20]],
"polar" => [[10,0],[100,720]],
});
point({"type" => "ccirc",
"color" => "Red",
"coordinates" => [[-100,-50],[30,20]],
"polar" => [[10,0],[50,1080]]});
|
|
point has many more options. If they are numeric, they can
usually be evolved. For example, you may give the ccirc a
color, change its radius, or replace ccirc by
oval which introduces options
like angle, width, or height. Here a few examples:
point({"type" => "ccirc",
"color" => "Red",
"coordinates" => [[20,20],[-50,-50]],
"radius" => [[20],[1]]});
point({"type" => "oval",
"angle" => [[20],[1000]],
"color" => "Blue",
"width" => [[10],[40]],
"coordinates" => [[-100,-50],[30,20]]});
|
|