MayaChemTools

Previous  TOC  NextMathUtil.pmCode | PDF | PDFGreen | PDFA4 | PDFA4Green

NAME

MathUtil

SYNOPSIS

use MathUtil;

use MathUtil qw(:all);

DESCRIPTION

MathUtil module provides a variety of common math functions not available in core Perl package or some other useful math utilities. In order to be consistent with other Perl functions, name of all the functions in this package are in lowercase which differs from MayaChemTools naming convention for function names.

MathUtil module provides the following functions:

acos, asin, ceil, floor, log10, max, min, random, round, tan

FUNCTIONS

acos
$Value = acos($AngleInRadians);

Returns the nverse cosine of an angle expressed in Radians using Math::Trig::acos function

asin
$Value = asin($AngleInRadians);

Returns the inverse sine of an angle expressed in Radians using Math::Trig::asin function

ceil
$IntegerValue = ceil($Value);

Returns the next largest integer for Value using POSIX::ceil function

floor
$IntegerValue = floor($Value);

Returns the previous smallest integer for Value using POSIX::floor function

log10
$Log10Value = log10($Value);

Returns the log of Value using base 10

max
$Number = max($Number1, $Number2);

Returns a Number corresponding to the maximum of Number1 and Number2

min
$Number = min($Number1, $Number2);

Returns a Number corresponding to the minimum of Number1 and Number2

random
$RadomNumber = random();
$RadomNumber = random($Number);
$RadomNumber = random($Number1, $Number1);

Returns a pseudo random number between 0 and 1, 0 and specified Number, or between Number1 and Number2

round
$RoundedValue = round($Number);
$RoundedValue = round($Number, $DecimalPlaces);

Returns a value corresponding to a nearst ingeter for Number or formatted to DecimalPlaces

tan
$Value = tan($AngleInRadians);

Returns the tangent of an angle expressed in Radians

AUTHOR

Manish Sud

SEE ALSO

Constants.pmConversionsUtil.pm

COPYRIGHT

Copyright (C) 2004-2008 Manish Sud. All rights reserved.

This file is part of MayaChemTools.

MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

 

 

Previous  TOC  NextApril 29, 2008MathUtil.pm