<commit_before>package Chipmunk::BB;

# ABSTRACT: Axis-aligned bounding box

use strict;
use warnings;
use Alien::Chipmunk;

require XSLoader;
XSLoader::load( 'Chipmunk::BB', $Chipmunk::BB::VERSION );

1;

__END__

=head1 SYNOPSIS

    ( $left, $bottom, $right, $top ) = ( 0, 10, 20, 30 );
    $bb = Chipmunk::BB->new( $left, $bottom, $right, $top );

    $point = [ 10, 20 ];
    $radius = 5;
    $circle_bb = Chipmunk::BB->new_for_circle( $point, $radius );

=head1 DESCRIPTION

Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)

=head1 METHODS

=head2 new

=over 4

=item Arguments: $left, $bottom, $right, $top

=item Return Value: $bb

=back

    ( $left, $bottom, $right, $top ) = ( 0, 10, 20, 30 );
    $bb = Chipmunk::BB->new( $left, $bottom, $right, $top );

=head2 new_for_circle

=over 4

=item Arguments: L<$point|Chipmunk::Vect>, $radius

=item Return Value: L<$bb|/new>

=back

    $point = [ 10, 20 ];
    $radius = 5;
    $circle_bb = Chipmunk::BB->new_for_circle( $point, $radius );

=head2 intersects

=over 4

=item Arguments: L<$other|/new>

=item Return value: $intersects

=back

    if ( $bb1->intersects($bb2) ) {
        print "Bounding boxes intersect\n";
    }

=head2 contains_bb

=over 4

=item Arguments: L<$other|/new>

=item Return value: $contains

=back

    if ( $bb1->contains($bb2) ) {
        print "bb1 contains bb2\n";
    }

=head2 contains_vect

=over 4

=item Arguments: L<$v|Chipmunk::Vect>

=item Return value: $contains

=back

    if ( $bb1->contains_vect($v) ) {
        print "bb1 contains vector v\n";
    }

=head2 merge

=over 4

=item Arguments: L<$other|/new>

=item Return value: L<$merged|/new>

=back

    $bb3 = $bb1->merge($bb2);

=head2 expand

=over 4

=item Arguments: L<$v|Chipmunk::Vect>

=item Return value: L<$expanded|/new>

=back

    $bb2 = $bb1->expand($v);

=head2 area

=over 4<commit_msg>Add some bounding box docs<commit_after>package Chipmunk::BB;

# ABSTRACT: Axis-aligned bounding box

use strict;
use warnings;
use Alien::Chipmunk;

require XSLoader;
XSLoader::load( 'Chipmunk::BB', $Chipmunk::BB::VERSION );

1;

__END__

=head1 SYNOPSIS

    ( $left, $bottom, $right, $top ) = ( 0, 10, 20, 30 );
    $bb = Chipmunk::BB->new( $left, $bottom, $right, $top );

    $point = [ 10, 20 ];
    $radius = 5;
    $circle_bb = Chipmunk::BB->new_for_circle( $point, $radius );

=head1 DESCRIPTION

Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)

=head1 METHODS

=head2 new

=over 4

=item Arguments: $left, $bottom, $right, $top

=item Return Value: $bb

=back

    ( $left, $bottom, $right, $top ) = ( 0, 10, 20, 30 );
    $bb = Chipmunk::BB->new( $left, $bottom, $right, $top );

=head2 new_for_circle

=over 4

=item Arguments: L<$point|Chipmunk::Vect>, $radius

=item Return Value: L<$bb|/new>

=back

    $point = [ 10, 20 ];
    $radius = 5;
    $circle_bb = Chipmunk::BB->new_for_circle( $point, $radius );

=head2 intersects

=over 4

=item Arguments: L<$other|/new>

=item Return value: $intersects

=back

Returns true if the bounding boxes intersect.

    if ( $bb1->intersects($bb2) ) {
        print "Bounding boxes intersect\n";
    }

=head2 contains_bb

=over 4

=item Arguments: L<$other|/new>

=item Return value: $contains

=back

Returns true if the bounding box completely contains C<$other>.

    if ( $bb1->contains($bb2) ) {
        print "bb1 contains bb2\n";
    }

=head2 contains_vect

=over 4

=item Arguments: L<$v|Chipmunk::Vect>

=item Return value: $contains

=back

Returns true if the bounding box contains <$v>.

    if ( $bb->contains_vect($v) ) {
        print "bb contains vector v\n";
    }

=head2 merge

=over 4

=item Arguments: L<$other|/new>

=item Return value: L<$merged|/new>

=back

Returns the minimal bounding box that contains both the original
bounding box and C<$other>.

    $bb3 = $bb1->merge($bb2);

=head2 expand

=over 4

=item Arguments: L<$v|Chipmunk::Vect>

=item Return value: L<$expanded|/new>

=back

Returns the minimal bounding box that contains both the original
bounding box and C<$v>.

    $bb2 = $bb1->expand($v);

=head2 area

=over 4
{'fraction_non_alphanumeric': 0.15931134820562562, 'fraction_numerical': 0.027643064985451018, 'mean_word_length': 3.6610169491525424, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6028865', 'n_tokens_mistral': 1763, 'n_tokens_neox': 1620, 'n_words': 447}