Create Plots of Triangles with Specified Vertices
Create graph paper on [0,20] x [0,20].
> cp2020 := coordplot( cartesian, [0..20,0..20] ):
>
Procedure for creating a plot of a triangle with specified vertices.
> drawtriangle := proc( a, b, c )
> point( A, op(a) );
> point( B, op(b) );
> point( C, op(c) );
> triangle( T, [A,B,C] );
> display( [draw(T,color=BLACK,thickness=3), cp2020], view=[0..20,0..20] );
> end proc:
>
A sample triangle:
> drawtriangle( [4,0], [16,0], [8,16] );
>
Create a sequence of PostScript plots of triangles (with the same area).
> for X from 0 to 20 by 2 do
> filename := "plot"||X||".ps";
> interface( plotdevice=postscript, plotoutput=filename );
> drawtriangle( [4,0], [16,0], [X,16] );
> interface( plotdevice=default );
> end do;
>