/home/jaubrey/webwork//pg_TRUNK/lib/Circle.pm

From WeBWorK

Jump to: navigation


NAME

        Circle

SYNPOSIS

    use Carp;
        use GD;
        use WWPlot;
        use Fun;

DESCRIPTION

This module defines a circle which can be inserted as a stamp in a graph (WWPlot) object.

Command:

        $circle_object = new Circle( $center_pos_x, $center_pos_y, $radius, $border_color, $fill_color);

Examples:

        Here is the code used to define the subroutines open_circle
        and closed_circle in PGgraphmacros.pl
                sub open_circle {
                    my ($cx,$cy,$color) = @_;
                        new Circle ($cx, $cy, 4,$color,'nearwhite');
                }
                sub closed_circle {
                    my ($cx,$cy, $color) = @_;
                    $color = 'black' unless defined $color;
                        new Circle ($cx, $cy, 4,$color, $color);
                }
        $circle_object2 = closed_circle( $x_position, $y_position, $color );
        @circle_objects = $graph -> stamps($circle_object2);
        # puts a filled dot at ($x_position, $y_position) on the graph -- using real world coordinates.