Skip to content

Restructure the POD of macros #1244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: PG-2.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 120 additions & 139 deletions lib/AnswerHash.pm

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/AnswerIO.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

=head1 NAME

AnswerIO.pm
AnswerIO.pm

=head1 SYNPOSIS
=head1 SYNOPSIS

This is not really an object, but it gives us a place to IO used by answer
macros.
Expand Down
2 changes: 1 addition & 1 deletion lib/Applet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Applet.pl - Provides code for inserting GeogebraWebApplets into webwork problems

=head1 SYNPOSIS
=head1 SYNOPSIS

###################################
# Create the applet object
Expand Down
2 changes: 1 addition & 1 deletion lib/ChoiceList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

=head1 NAME

ChoiceList.pm -- super-class for all ChoiceList structures
ChoiceList.pm - super-class for all ChoiceList structures

=head1 SYNOPSIS

Expand Down
41 changes: 20 additions & 21 deletions lib/Circle.pm
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

=head1 NAME

Circle
Circle

=head1 SYNPOSIS
=head1 SYNOPSIS

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


=head1 DESCRIPTION
Expand All @@ -17,29 +17,28 @@ This module defines a circle which can be inserted as a stamp in a graph (WWPlot

=head2 Command:

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

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

=head2 Examples:

Here is the code used to define the subroutines open_circle
and closed_circle in PGgraphmacros.pl
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 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);
}
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_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.
@circle_objects = $graph -> stamps($circle_object2);
# puts a filled dot at ($x_position, $y_position) on the graph -- using real world coordinates.

=cut

Expand Down
49 changes: 24 additions & 25 deletions lib/Fraction.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,46 @@
# numerator/denominator.
# VS 7/20/2000

=head3 Fraction
=head1 Name

This object is designed to ease the use of fractions
Fraction - This object is designed to ease the use of fractions

=head4 Variables and Methods
=head1 Variables and Methods

Variables
Variables

numerator #numerator of fraction
denominator #denominator of fraction
numerator #numerator of fraction
denominator #denominator of fraction

Arithmetic Methods #these will all accept a scalar value or
#another fraction as an argument
Arithmetic Methods #these will all accept a scalar value or
#another fraction as an argument

plus #returns the sum of the fraction and argument
minus #returns fraction minus argument
subtractFrom #returns argument minus fraction
divBy #returns fraction divided by argument
divInto #returns argument divided by fraction
times #returns fraction times argument
compare #returns <, =, or > for the relation of fraction to argument
plus #returns the sum of the fraction and argument
minus #returns fraction minus argument
subtractFrom #returns argument minus fraction
divBy #returns fraction divided by argument
divInto #returns argument divided by fraction
times #returns fraction times argument
compare #returns <, =, or > for the relation of fraction to argument

pow #returns fraction raised to argument, a given integer power
pow #returns fraction raised to argument, a given integer power


Other methods
Other methods

reduce #reduces to lowest terms, and makes sure denominator is positive
scalar #returns the scalar value numerator/denominator
print #prints the fraction
print_mixed #prints the fractionas a mixed number
print_inline #prints the fraction like this 2/3
reduce #reduces to lowest terms, and makes sure denominator is positive
scalar #returns the scalar value numerator/denominator
print #prints the fraction
print_mixed #prints the fractionas a mixed number
print_inline #prints the fraction like this 2/3


=head4 Synopsis
=head1 Synopsis

The fraction object stores two variables, numerator and denominator. The basic
The fraction object stores two variables, numerator and denominator. The basic
arithmatic methods listed above can be performed on a fraction, and it can return its own
scalar value for use with functions expecting a scalar (ie, sqrt($frac->scalar) ).


=cut

package Fraction;
Expand Down
4 changes: 2 additions & 2 deletions lib/Fun.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

=head1 NAME

Fun
Fun

=head1 SYNPOSIS
=head1 SYNOPSIS

use Carp;
use GD;
Expand Down
41 changes: 17 additions & 24 deletions lib/Hermite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,31 @@ use Carp;

=head1 NAME

Hermite.pm
Hermite.pm

=head1 SYNPOSIS

Usage:
$obj = new Hermit(\@x_values, \y_valuses \@yp_values);

#get and set methods
$ra_x_values = $obj -> ra_x(\@x_values);
$ra_y_values = $obj -> ra_y;
$ra_yp_values = $obj -> ra_yp;

$obj -> initialize; # calculates the approximation

#get methods
$rf_function = $obj -> rf_f;
$rf_function_derivative = $obj -> rf_fp;
$rf_function_2nd_derivative = $obj -> rf_fpp;

$rh_critical_points =$obj -> rh_critical_points
$rh_inflection_points =$obj -> rh_inflection_points
=head1 SYNOPSIS

Usage:

$obj = new Hermit(\@x_values, \y_valuses \@yp_values);

#get and set methods
$ra_x_values = $obj -> ra_x(\@x_values);
$ra_y_values = $obj -> ra_y;
$ra_yp_values = $obj -> ra_yp;
$obj -> initialize; # calculates the approximation
#get methods
$rf_function = $obj -> rf_f;
$rf_function_derivative = $obj -> rf_fp;
$rf_function_2nd_derivative = $obj -> rf_fpp;
$rh_critical_points =$obj -> rh_critical_points
$rh_inflection_points =$obj -> rh_inflection_points

=head1 DESCRIPTION

This module defines an object containing a Hermite spline approximation to a function.
The approximation
consists of a piecewise cubic polynomial which agrees with the original
function and its first derivative at
the node points.
The approximation consists of a piecewise cubic polynomial which agrees with the original
function and its first derivative at the node points.

This is useful for creating on the fly graphics. Care must be taken to use a small
number of points spaced reasonably far apart, preferably
Expand Down
8 changes: 4 additions & 4 deletions lib/Label.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

=head1 NAME

Label
Label


=head1 SYNPOSIS
=head1 SYNOPSIS

use Carp;
use GD;
Expand All @@ -19,8 +19,8 @@ This module defines labels for the graph objects (WWPlot).

=head2 Usage

$label1 = new Label($x_value, $y_value, $label_string, $label_color, @options)
$options is an array with (*'d defaults)
$label1 = new Label($x_value, $y_value, $label_string, $label_color, @options)
$options is an array with (*'d defaults)
- one of 'left'*, 'center', 'right' (horizontal alignment)
- one of 'bottom', 'center', 'top'* (verical alignment)
- one of 'horizontal'*, 'vertical' (orientation)
Expand Down
2 changes: 1 addition & 1 deletion lib/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

=head1 NAME

List.pm -- super-class for all list structures
List.pm - super-class for all list structures

=head1 SYNOPSIS

Expand Down
Loading