{"id":20550326,"url":"https://github.com/dnmfarrell/math-shape-point","last_synced_at":"2025-03-06T05:44:05.144Z","repository":{"id":19762742,"uuid":"23020468","full_name":"dnmfarrell/Math-Shape-Point","owner":"dnmfarrell","description":"Perl class for a 2d point object in cartesian space with utility angle methods ","archived":false,"fork":false,"pushed_at":"2014-09-01T03:05:25.000Z","size":228,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T16:49:40.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnmfarrell.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-16T15:11:29.000Z","updated_at":"2016-11-08T20:06:47.000Z","dependencies_parsed_at":"2022-08-25T02:02:10.395Z","dependency_job_id":null,"html_url":"https://github.com/dnmfarrell/Math-Shape-Point","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FMath-Shape-Point","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FMath-Shape-Point/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FMath-Shape-Point/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FMath-Shape-Point/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnmfarrell","download_url":"https://codeload.github.com/dnmfarrell/Math-Shape-Point/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242157180,"owners_count":20081036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T02:24:26.846Z","updated_at":"2025-03-06T05:44:05.124Z","avatar_url":"https://github.com/dnmfarrell.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=encoding UTF-8\n\n=head1 NAME\n\nMath::Shape::Point - a 2d point object in cartesian space with utility angle methods\n\n=head1 VERSION\n\nversion 1.05\n\n=head1 SYNOPSIS\n\n    use Math::Shape::Point;\n    use Math::Trig ':pi';\n\n    my $p1 = Math::Shape::Point-\u003enew(0, 0, 0);\n    my $p2 = Math::Shape::Point-\u003enew(5, 5, 0);\n    $p1-\u003erotate_about_point($p2, pip2);\n    my $angle = $p1-\u003eget_angle_to_point($p2);\n    my $distance = $p1-\u003eget_distance_to_point($p2);\n\n=head1 DESCRIPTION\n\nThis module is designed to provide some useful 2d functions for manipulating point shapes in cartesian space. Advanced features include rotating around another point, calculating the distance to a point and the calculating the angle to another point. The module uses cartesian coordinates and radians throughout.\n\n=for HTML \u003ca href=\"https://travis-ci.org/sillymoose/Math-Shape-Point\"\u003e\u003cimg src=\"https://travis-ci.org/sillymoose/Math-Shape-Point.svg?branch=master\"\u003e\u003c/a\u003e\n\u003ca href='https://coveralls.io/r/sillymoose/Math-Shape-Point'\u003e\u003cimg src='https://coveralls.io/repos/sillymoose/Math-Shape-Point/badge.png' alt='Coverage Status' /\u003e\u003c/a\u003e\n\n=head1 METHODS\n\n=head2 new\n\nInstantiates a new point object. Requires the x and y cartesian coordinates and the facing direction in radians.\n\n    my $p = Math::Shape::Point-\u003enew(0, 0, 0);\n\n=head2 get_location\n\nReturns an arrayref containing the point's location in cartesian coordinates.\n\n    $p-\u003eget_location;\n\n=head2 set_location\n\nSets the point's location in cartesian coordinates. Requires two numbers as inputs for the x and y location.\n\n    $p-\u003eset_location($x, $y);\n\n=head2 get_direction\n\nReturns the current facing direction in radians.\n\n    $p-\u003eget_direction;\n\n=head2 set_direction\n\nSets the current facing direction in radians.\n\n    $p-\u003eset_direction(2.5);\n\n=head2 advance\n\nRequires a numeric distance argument - moves the point forward that distance in Cartesian coordinates towards the direction it is facing.\n\n    $p-\u003eadvance(5);\n\n=head2 retreat\n\nRequires a numeric distance argument - moves the point backwards that distance in Cartesian coordinates from the direction it is facing.\n\n    $p-\u003eretreat(5);\n\n=head2 move_left\n\nRequires a numeric distance argument - moves the point that distance to the left.\n\n    $p-\u003emove_left(3);\n\n=head2 move_right\n\nRequires a numeric distance argument - moves the point that distance to the right.\n\n    $p-\u003emove_right(7);\n\n=head2 rotate\n\nUpdates the point's facing direction by radians.\n\n    $p-\u003erotate(2);\n\n=head2 rotate_about_point\n\nRotates the point around another point of origin. Requires a point object and the angle in radians to rotate. This method updates the facing direction of the point object, as well as it's location.\n\n    my $p1 = Math::Shape::Point-\u003enew(0, 0, 0); #new point at 0,0 facing 0 radians.\n    my $p2 = Math::Shape::Point-\u003enew(1, 2, 0); #new point at 1,2 facing 0 radians.\n    $p1-\u003erotate_about_point($p2, 3.14);\n\n=head2 get_distance_to_point\n\nReturns the distance to another point object. Requires a point object as an argument.\n\n    $p1-\u003eget_distance_to_point($p2);\n\n=head2 get_angle_to_point\n\nReturns the angle of another point object. Requires a point as an argument.\n\n    $p1-\u003eget_angle_to_point($p2);\n\n=head2 get_direction_to_point\n\nReturns the direction of another point objection as a string (front, right, back or left). Assumes a 90 degree angle per direction.  Requires a point object as an argument.\n\n    $p1-\u003eget_direction_to_point($p2); # front\n\n=head2 normalize_radian\n\nTakes a radian argument and returns it between 0 and PI2. Negative numbers are assumed to be backwards (e.g. -1.57 == PI + PI / 2)\n\n=head2 print_coordinates\n\nPrints a small grid and indicates the location of the point with an '@'.\n\n=head1 AUTHOR\n\nDavid Farrell, C\u003c\u003c \u003cdavidnmfarrell at gmail.com\u003e \u003e\u003e, L\u003cperltricks.com|http://perltricks.com\u003e\n\n=head1 BUGS\n\nPlease report any bugs or feature requests to C\u003cbug-math-shape-point at rt.cpan.org\u003e, or through\nthe web interface at L\u003chttp://rt.cpan.org/NoAuth/ReportBug.html?Queue=math-shape-point\u003e.  I will be notified, and then you'll automatically be notified of\nprogress on your bug as I make changes.\n\n=head1 SUPPORT\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Math::Shape::Point\n\n=head1 REPOSITORY\n\nL\u003chttps://github.com/sillymoose/Math-Shape-Point.git\u003e\n\n=head1 AUTHOR\n\nDavid Farrell \u003csillymoos@cpan.org\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2014 by David Farrell.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fmath-shape-point","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnmfarrell%2Fmath-shape-point","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Fmath-shape-point/lists"}