> 1- Does anyone know if you can draw a square with a XY graph?
> 2- Does anyone know of a really simple example (not using arrays) to
> draw a rectangle?
> 3- Is the XY graph the best way to draw a rectangle?
>
This will be quite simple, but it will require you to use arrays to some
extent along with some trig.
To draw an array that is not rotated at all, you need four points such
as (0,0) (0,1) (1,1) (1,0). If drawing the outline, you will want to
include the first point again as the fifth element in the array.
To rotate a point by theta about the origin, you will want to multiply
the X by the cosine of theta and the Y by the sine of theta. To rotate
a shape like the rectangle by theta about the origin, you multiply each
point in the same way.
It gets a bit more complicated if you wish to rotate them about another
point. You will want to offset all the points, do the rotation, then
add the offset back.
If this is too condensed, please look for a tutorial about graphics. It
is usually quite easy to find tutorials on various University sites.
Finally, if you wish to do more complex graphics, you might want to
consider using the picture control instead of the cartesian graph. The
graph is quite flexible, but it is a graph, and not a drawing tool.
Greg McKaskle