NAME
Algorithm::Health::BFI - Interface to Body Fat Index.
VERSION
Version 0.01
DESCRIPTION
A person's body fat percentage is the total weight of the person's fat divided by the person's weight and consists of essential body fat and storage body fat.Essential body fat is necessary to maintain life and reproductive functions. Storage body fat consists of fat accumulation in adipose tissue, part of which protects internal organs in the chest and abdomen.
Some regard the body fat percentage as the better measure of an individual's fitness level, as it is the only body measurement which directly calculates the particular individual's body composition without regard to the individual's height or weight.
CONSTRUCTOR
It expects optionally reference to an anonymous hash with the following keys:
+-------------+----------+---------+
| Key | Value | Default |
+-------------+----------+---------+
| weight_unit | kg/lb/st | lb |
| length_unit | m /in/ft | in |
+-------------+----------+---------+
use strict; use warnings;
use Algorithm::Health::BFI;
my $bfi_1 = Algorithm::Health::BFI->new({ weight_unit => 'st', length_unit => 'ft' });
# or simply
my $bfi_2 = Algorithm::Health::BFI->new();
METHODS
get_bfi(mass, height)
Return Body Fat Index for the given input.
use strict; use warnings;
use Algorithm::Health::BFI;
my $bfi = Algorithm::Health::BFI->new();
print $bfi->get_bfi({sex => 'f', weight => 60, waist => 38, wrist => 3, hips => 30, forearm => 3}) . "\n";
print $bfi->get_bfi({sex => 'm', weight => 60, waist => 40}) . "\n";
get_category()
Different cultures value different body compositions differently at different times, and some are related to health/athletic performance. Levels of body fat are epidemiologically dependent on gender and age. Different authorities have developed different recommendations for ideal body fat percentages.The table below describes different percentages but isn't recommendation.
+---------------+--------+--------+
| Category | Women | Men |
+---------------+--------+--------+
| Essential Fat | 10-13% | 2-5% |
| Athletes | 14-20% | 6-13% |
| Fitness | 21-24% | 14-17% |
| Average | 25-31% | 18-24% |
| Obese | 32%+ | 25%+ |
+---------------+--------+--------+
use strict; use warnings;
use Algorithm::Health::BFI;
my $bfi = Algorithm::Health::BFI->new();
print $bfi->get_bfi({sex => 'm', weight => 60, waist => 40}) . "\n";
print $bfi->get_category() . "\n";
AUTHOR
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
BUGS
Please report any bug/feature requests to bug-algorithm-health-bfi at rt.cpan.org
/ through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-Health-BFI. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Algorithm::Health::BFI
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Algorithm-Health-BFI
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
Copyright 2011 Mohammad S Anwar.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
DISCLAIMER
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.