Niouzes

< Décembre 2018 >
Lu Ma Me Je Ve Sa Di
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Citation

Attention

The documentation is incomplete. The Vae Soli! team works hard to make it as exhaustive as possible with tons of useful examples and easy to understand explanations.

On top of that, we have decided to use our own tool to generate the documentation you read. This also takes time to fine-tune. Our goal is have better documentation, easier to read, easier to use, completely integrated with our site.

Even though NOT finalized, you can now link back to our documentation pages as we have decided once and for all about the structure of our documents and where they all reside on our server.

Thank you very much
The Vae Soli! team.

2018-12-06 à 02:12:30

Table Of Contents

  1. FOUNDATION (functions) (01/04/2015)
  2. LSAction (class) (01/04/2015)
  3. LSAddress (class) (01/04/2015)
  4. LSAdministrativeArea (class) (01/04/2015)
  5. LSApplication (class) (14/10/2013)
  6. LSArray (class) (14/10/2013)
  7. LSArticle (class) (18/02/2014)
  8. LSAssertion (class) (14/10/2013)
  9. LSAudience (class) (18/02/2014)
  10. AUTOLOAD (function) (21/04/2014)
  11. LSAutoReference (class) (14/10/2013)
  12. LSBag (class) (14/10/2013)
  13. LSBBCodes (class) (10/06/2014)
  14. LSBrowser (class) (14/10/2013)
  15. LSCache (class) (14/10/2013)
  16. LSCalculator (class) (14/10/2013)
  17. LSCalendar (class) (14/10/2013)
  18. LSCameraSnapshot (class) (14/10/2013)
  19. LSCitation (class) (14/10/2013)
  20. LSClass (class) (14/10/2013)
  21. LSCode (class) ()
  22. Colors (functions) (06/12/2018)
  23. LSContactForm (class) (14/10/2013)
  24. LSContainer (class) (14/10/2013)
  25. LSContents (class) (14/10/2013)
  26. LSContentsAccounts (class) (14/10/2013)
  27. LSContentsArticles (class) (14/10/2013)
  28. LSContentsAtomicClock (class) (14/10/2013)
  29. LSContentsBusinessCoordinates (class) (14/10/2013)
  30. LSContentsBusinessOff (class) (14/10/2013)
  31. LSContentsBusinessOpeningHours (class) (14/10/2013)
  32. LSContentsBreadcrumb (class) (14/10/2013)
  33. LSContentsCalendar (class) (14/10/2013)
  34. LSContentsCatalogue (class) (14/10/2013)
  35. LSContentsCharter (class) (18/02/2014)
  36. LSContentsCitation (class) (14/10/2013)
  37. LSContentsClock (class) (14/10/2013)
  38. LSContentsComments (class) (14/10/2013)
  39. LSContentsCookieUsage (class) (14/10/2013)
  40. LSContentsCountdown (class) (14/10/2013)
  41. LSContentsDatetime (class) (14/10/2013)
  42. LSContentsHeartbeat (class) (14/10/2013)
  43. LSContentsIFrame (class) (14/10/2013)
  44. LSContentsImageGallery (class) (14/10/2013)
  45. LSContentsLanguageSwitchers (class) (14/10/2013)
  46. LSContentsLegal (class) (18/02/2014)
  47. LSContentsMicronews (class) (14/10/2013)
  48. LSContentsMyAccount (class) (14/10/2013)
  49. LSContentsPaymentOptions (class) (14/10/2013)
  50. LSContentsPinboard (class) (14/10/2013)
  51. LSContentsRememberPassword (class) (14/10/2013)
  52. LSContentsRSS (class) (14/10/2013)
  53. LSContentsSiteManager (class) (14/10/2013)
  54. LSContentsSitemap (class) (14/10/2013)
  55. LSContentsShare (class) (14/10/2013)
  56. LSContentsStopwatch (class) (14/10/2013)
  57. LSContentsTagCloud (class) (14/10/2013)
  58. LSContentsTodosOnPage (class) (14/10/2013)
  59. LSContentsW3C (class) (14/10/2013)
  60. LSContentsWeather (class) (14/10/2013)
  61. LSControl (class) (14/10/2013)
  62. LSCreativeWork (class) (18/02/2014)
  63. LSCursor (class) (09/03/2015)
  64. LSCustomer (class) (14/10/2013)
  65. LSDataEnvironment (class) (14/10/2013)
  66. Dates (functions) (01/04/2015)
  67. LSDate (class) (14/10/2013)
  68. LSDictionary (class) (14/10/2013)
  69. LSDom, LSDomNode and LSXPath (class) (30/04/2014)
  70. LSErrors and LSError (classes) (14/10/2013)
  71. LSException (class) (16/10/2013)
  72. LSExplorer (class) (14/10/2013)
  73. LSFieldset (class) (14/10/2013)
  74. LSFile (class) (14/10/2013)
  75. LSFileProperties (class) (14/10/2013)
  76. Files (functions) (01/04/2015)
  77. Finance (functions) (01/04/2015)
  78. LSFootnotes (class) (22/02/2014)
  79. LSForm (class) (09/06/2014)
  80. LSFunction (class) (14/10/2013)
  81. LSGeorama (class) (24/10/2013)
  82. LSGeoramaVar (class) (24/10/2013)
  83. LSGlossary (class) (09/03/2015)
  84. LSGroup (class) (14/10/2013)
  85. HTML (functions) (01/04/2015)
  86. LSHttp (class) (14/10/2013)
  87. HTTP (functions) (01/04/2015)
  88. LSImageGallery (class) (14/10/2013)
  89. Images (functions) (01/04/2015)
  90. LSInput (class) (26/04/2014)
  91. IP (functions) (01/04/2015)
  92. LSIslandAbstract (14/10/2013)
  93. LSIslandFormAbstract (class) (14/10/2013)
  94. LSLabel (class) (14/10/2013)
  95. LSLanguageSwitchers (class) (14/10/2013)
  96. LSLatin (class) (14/10/2013)
  97. LSLegalPerson (class) (14/10/2013)
  98. LSLinkedList (class) (14/10/2013)
  99. LSList (class) (14/10/2013)
  100. Mails (functions) (01/04/2015)
  101. LSMap (class) (14/10/2013)
  102. Math (functions) (01/04/2015)
  103. LSMicronews (class) (18/02/2014)
  104. Miscellaneous (functions) (01/04/2015)
  105. LSModuleAbstract (class) (14/10/2013)
  106. LSNaturalPerson (class) (14/10/2013)
  107. LSNewsArticle (class) (18/02/2014)
  108. LSNote (class) (14/10/2013)
  109. LSMotherNature (class) (16/10/2013)
  110. LSPage (class) (18/02/2014)
  111. LSParameter (class) (14/10/2013)
  112. LSPaymentOptions (class) (14/10/2013)
  113. LSPeopleAudience (class) (18/02/2014)
  114. LSPerson (class) (14/10/2013)
  115. LSPlace (class) (18/02/2014)
  116. LSProperty (class) (14/10/2013)
  117. LSPublication (class) (14/10/2013)
  118. LSRequirement (class) (14/10/2013)
  119. LSReturn (class) (24/10/2013)
  120. LSRisk (class) (14/10/2013)
  121. LSSentanaiAbstract (14/10/2013)
  122. LSServiceMessage (class) (14/10/2013)
  123. LSSession (class) (14/10/2013)
  124. LSSiteManager (class) (14/10/2013)
  125. LSSitemap (class) (14/10/2013)
  126. LSSockets (class) (14/10/2013)
  127. LSSoftwareApplication (class) (18/02/2014)
  128. LSSource (class) (14/10/2013)
  129. Strings (functions) (31/07/2016)
  130. LSSupplier (class) (14/10/2013)
  131. System (functions) (01/04/2015)
  132. LSTag (class) (21/04/2014)
  133. LSTagCloud (class) (14/10/2013)
  134. LSTechArticle (class) (18/02/2014)
  135. LSThing (class) (18/02/2014)
  136. LSTimeline (class) (14/10/2013)
  137. LSTimer (class) (16/10/2013)
  138. LSTracer (class) (09/03/2015)
  139. LSUnitTesting (class) (14/10/2013)
  140. URL (functions) (01/04/2015)
  141. LSUser (class) (09/03/2015)
  142. LSUserMgr (class) (14/10/2013)
  143. LSVaesoli (class) (09/06/2014)
  144. LSVersion (class) (14/10/2013)
  145. LSWebSite (class) (14/10/2013)
  146. LSWidget (class) (14/10/2013)
  147. LSWireTransferForm (class) (14/10/2013)
  148. LSXMLSitemap (class) (14/10/2013)
  149. XML (functions) (01/04/2015)

LSMath.functions.php

Generated by The Vae Soli! Documentor: Guide v. 1.3.0018 on 01-04-2015 16:19:53 (DD-MM-YYYY HH:mm:SS). This documentation is built with Vae Soli! functions and classes!

The download page of Vae Soli! contains all sources of the framework.

Additional samples are available on the samples page of Vae Soli!.

File Properties

C:\websites\vaesoli.org\www\httpdocs/vaesoli/include/LSMath.functions.phpC:\websites\vaesoli.org\www\httpdocs\vaesoli\include\LSMath.functions.phpapplication/force-downloadC:\websites\vaesoli.org\www\httpdocs\vaesoli\include43437 bytes03/08/2013 23:27:5210/06/2014 14:44:3210/06/2014 14:44:32

Compliance

Assertions count: 41

Assertions successful: 41

Assertion failures: 0

Early Warning

LSMath.functions.php contains 1670 lines of code, which exceeds the suggested limit of 1024 lines. We suggest this file got broken down in smaller chunks!

0001 ... <?php
0002 ... /**************************************************************************/
0003 ... /** {{{*fheader
0004 ...     {*file                  LSMath.functions.php *}
0005 ...     {*purpose               Mathematical functions (all purpose) *}
0006 ...     {*author                 *}
0007 ...     {*company               Lato Sensu Management[br]
0008 ...                             Rue Bois des Mazuis, 47[br]
0009 ...                             5070 Vitrival[br]
0010 ...                             Belgium (BE)[br]
0011 ...                             http://www.latosensu.be[br]
0012 ...                             Vae Soli! : http://www.vaesoli.org *}
0013 ...     {*cdate                 18/07/2012 - 16:59 *}
0014 ...     {*mdate                 auto *}
0015 ...     {*license               [url]http://creativecommons.org/licenses/by-sa/2.0/be/[/url][br]
0016 ... 
0017 ...                             To obtain detailed information about the license
0018 ...                             terms, please head to the full license text
0019 ...                             available in the [file]LSCopyright.php[/file] file *}
0020 ... 
0021 ...     ------------------------------------------------------------------------
0022 ...     Changes History:
0023 ...     ------------------------------------------------------------------------
0024 ... 
0025 ...     {*chist
0026 ...         {*mdate 18/07/2012 *}
0027 ...         {*v 5.0.0005 *}
0028 ...         {*desc              Original creation
0029 ...         *}
0030 ...     *}
0031 ... 
0032 ...     {*chist
0033 ...         {*mdate 09/06/2014 *}
0034 ...         {*v 6.0.0008 *}
0035 ...         {*desc              Math functions to calculate volumes and areas
0036 ...         *}
0037 ...     *}
0038 ... 
0039 ...     *}}} */
0040 ... /**************************************************************************/
0041 ... if ( ! defined( 'VAESOLI_PATH' ) )                                  /* If the path is not defined yet */
0042 ... {
0043 ...     /* {*define (VAESOLI_PATH)  Define the path where Vae Soli! is installed *} */
0044 ...     define( 'VAESOLI_PATH',__DIR__ );
0045 ... }   /* if ( ! defined( 'VAESOLI_PATH' ) ) */
0046 ... 
0047 ... if ( ! defined( 'VAESOLI_PLUGINS' ) )                               /* If the path is not defined yet */
0048 ... {
0049 ...     /* {*define (VAESOLI_PLUGINS)  Define the path where plugins are located *} */
0050 ...     define( 'VAESOLI_PLUGINS',VAESOLI_PATH . '/../plugins' );
0051 ... }   /* if ( ! defined( 'VAESOLI_PLUGINS' ) ) */
0052 ... 
0053 ... /* ====================================================================== */
0054 ... /** {{*MATH_GeoDistance( $x1,$y1,$x2,$y2 )=
0055 ... 
0056 ...     Calculates  the distance between 2 points (oblateness of the earth considered)
0057 ... 
0058 ...     {*params
0059 ...         $x1 (float) WGS84 geo-coordinate in decimal degree (x-coord) of point 1
0060 ...         $y1 (float) WGS84 geo-coordinate in decimal degree (y-coord) of point 1
0061 ...         $x2 (float) WGS84 geo-coordinate in decimal degree (x-coord) of point 2
0062 ...         $y2 (float) WGS84 geo-coordinate in decimal degree (y-coord) of point 2
0063 ...     *}
0064 ... 
0065 ...     {*caution
0066 ...         The formula is a simplification of the problem and it won't work accurately
0067 ...         if the 2 points are too close to each other or too close to the poles
0068 ...     *}
0069 ... 
0070 ...     {*credits   [url]http://www.addressdoctor.com/en/support/faq/faq-geocoding.html[/url]
0071 ...     *}
0072 ... 
0073 ...     {*doc       [url]http://fr.wikipedia.org/wiki/WGS84[/url]
0074 ...                 [url]http://fr.wikipedia.org/wiki/Terre[/url]
0075 ...     *}
0076 ... 
0077 ...     {*version
0078 ...         5.0.0005
0079 ...     *}
0080 ... 
0081 ...     {*cdate
0082 ...         18/07/2012 21:48:54
0083 ...     *}
0084 ... 
0085 ...     {*return
0086 ...         (float)     Distance in meters between 2 geo points (latitude and longitude)
0087 ...     *}
0088 ... 
0089 ...     {*exec
0090 ...         // Home : Rue Bois des Mazuis, 47 - 5070 Vitrival
0091 ...         $x1         = 4.660489;     // Longitude
0092 ...         $y1         = 50.385496;    // Latitude
0093 ... 
0094 ...         // Work: Avenue du Boulevard 21, 1210 Saint-Josse-ten-Noode, Belgium (BE)
0095 ...         $x2         = 4.356916;     // Longitude
0096 ...         $y2         = 50.855891;    // Latitude
0097 ... 
0098 ...         echo '<p>',number_format( ( $fDistance = MATH_GeoDistance($x1,$y1,$x2,$y2 ) ) / 1000,2,',','.' ),'km</p>';
0099 ... 
0100 ...         echo LSUnitTesting::assert( $fDistance > 62100 && $fDistance < 62200                ,
0101 ...                                     'ASSERTION SUCCESSFUL: distance calculated correctly'   ,
0102 ...                                     'ASSERTION FAILURE: wrong distance'                     ,
0103 ...                                     'GuideAssert' );
0104 ... 
0105 ...     *}
0106 ... 
0107 ...     *}}
0108 ...  */
0109 ... /* ========================================================================== */
0110 ... function MATH_GeoDistance( $x1,$y1,$x2,$y2 )
0111 ... /*----------------------------------------*/
0112 ... {
0113 ...     /* 6378137 = rayon équatorial de la Terre en mètres */
0114 ... 
0115 ...     return ( 6378137 * acos( sin( $a = deg2rad( $x2 ) ) * sin( $b = deg2rad( $x1 ) ) + cos( $a ) * cos( $b ) * cos( deg2rad( $y2 ) - deg2rad( $y1 ) ) ) );
0116 ... }   /* End of function MATH_GeoDistance() =================================== */
0117 ... 
0118 ... function MATH_Between( $x,$fLow,$fHigh,$fTolerance = 0.0 )
0119 ... /*-----------------------------------------------------*/
0120 ... {
0121 ...     return ( ( $x >= ( $fLow - $fTolerance ) ) && ( $x <= ( $fHigh + $fTolerance ) ) );
0122 ... }   /* End of function MATH_Between() ======================================= */
0123 ... 
0124 ... /* ========================================================================== */
0125 ... /** {{*MATH_RectangularVolume( $l,$w,$h )=
0126 ... 
0127 ...     Calculates the volume of a rectangular solid
0128 ... 
0129 ...     {*params
0130 ...         $l  (float) length of the rectangular solid
0131 ...         $w  (float) width of the rectangular solid
0132 ...         $h  (float) height of the rectangular solid
0133 ...     *}
0134 ... 
0135 ...     {*return
0136 ...         (float)     Volume of the rectangular solid
0137 ...     *}
0138 ... 
0139 ...     {*version
0140 ...         6.0.0008
0141 ...     *}
0142 ... 
0143 ...     {*cdate
0144 ...         09/06/2014 11:27
0145 ...     *}
0146 ... 
0147 ...     {*assert
0148 ...         MATH_RectangularVolume( 5,5,5 ) === MATH_CubeVolume( 5 )
0149 ...     *}
0150 ... 
0151 ...     {*assert
0152 ...         MATH_RectangularVolume( 5,6,7 ) === (float) 210
0153 ...     *}
0154 ... 
0155 ...     {*group volume *}
0156 ... 
0157 ...     {*seealso
0158 ...         MATH_CubeVolume(), MATH_SphereVolume()
0159 ...     *}
0160 ... 
0161 ...     *}}
0162 ...  */
0163 ... /* ========================================================================== */
0164 ... function MATH_RectangularVolume( $l,$w,$h )
0165 ... /*---------------------------------------*/
0166 ... {
0167 ...     return ( (float) $l * $w * $h );
0168 ... }   /* End of function MATH_RectangularVolume() ============================= */
0169 ... 
0170 ... /* ========================================================================== */
0171 ... /** {{*MATH_CubeVolume( $a )=
0172 ... 
0173 ...     Calculates the volume of a cube
0174 ... 
0175 ...     {*params
0176 ...         $a  (float) side of the cube
0177 ...     *}
0178 ... 
0179 ...     {*return
0180 ...         (float)     Volume of the cube
0181 ...     *}
0182 ... 
0183 ...     {*version
0184 ...         6.0.0008
0185 ...     *}
0186 ... 
0187 ...     {*cdate
0188 ...         09/06/2014 10:58
0189 ...     *}
0190 ... 
0191 ...     {*group volume *}
0192 ... 
0193 ...     {*assert
0194 ...         MATH_CubeVolume( 10 ) !== 1000
0195 ...     *}
0196 ... 
0197 ...     {*assert
0198 ...         MATH_CubeVolume( 10 ) === (float) 1000
0199 ...     *}
0200 ... 
0201 ...     {*assert
0202 ...         (int) MATH_CubeVolume( 10 ) === 1000
0203 ...     *}
0204 ... 
0205 ...     {*seealso
0206 ...         MATH_RectangularVolume(), MATH_SphereVolume()
0207 ...     *}
0208 ... 
0209 ...     *}}
0210 ...  */
0211 ... /* ========================================================================== */
0212 ... function MATH_CubeVolume( $a )
0213 ... /*--------------------------*/
0214 ... {
0215 ...     return ( MATH_RectangularVolume( $a,$a,$a ) );
0216 ... }   /* End of function MATH_CubeVolume() ==================================== */
0217 ... 
0218 ... /* ========================================================================== */
0219 ... /** {{*MATH_SphereVolume( $r )=
0220 ... 
0221 ...     Calculates the volume of a sphere
0222 ... 
0223 ...     {*params
0224 ...         $a  (float) radius of the sphere
0225 ...     *}
0226 ... 
0227 ...     {*version
0228 ...         6.0.0008
0229 ...     *}
0230 ... 
0231 ...     {*cdate
0232 ...         09/06/2014 11:02
0233 ...     *}
0234 ... 
0235 ...     {*return
0236 ...         (float) Volume of the sphere
0237 ...     *}
0238 ... 
0239 ...     {*warning
0240 ...         The result that is given back is an approximation given the
0241 ...         irrationality of Pi
0242 ...     *}
0243 ... 
0244 ...     {*exec
0245 ...         echo MATH_SphereVolume( 6 );
0246 ...     *}
0247 ... 
0248 ...     {*assert
0249 ...         MATH_Between( MATH_SphereVolume( 6 ),904.77,904.78,0.001 )
0250 ...     *}
0251 ... 
0252 ...     {*assert
0253 ...         MATH_Between( MATH_SphereVolume( 6 ),904.778,904.779 )
0254 ...     *}
0255 ... 
0256 ...     {*group volume *}
0257 ... 
0258 ...     *}}
0259 ...  */
0260 ... /* ========================================================================== */
0261 ... function MATH_SphereVolume( $r )
0262 ... /*----------------------------*/
0263 ... {
0264 ...     return ( 4/3 * pi() * ( $r * $r * $r ) );
0265 ... }   /* End of function MATH_SphereVolume() ================================== */
0266 ... 
0267 ... /* ========================================================================== */
0268 ... /** {{*MATH_PyramidVolume( $l,$w,$h )=
0269 ... 
0270 ...     Calculates the volume of a rectangular solid
0271 ... 
0272 ...     {*params
0273 ...         $l  (float) length of the base of the pyramid
0274 ...         $w  (float) width of the base of the pyramid
0275 ...         $h  (float) height of the pyramid
0276 ...     *}
0277 ... 
0278 ...     {*return
0279 ...         (float)     Volume of the pyramid
0280 ...     *}
0281 ... 
0282 ...     {*version
0283 ...         6.0.0008
0284 ...     *}
0285 ... 
0286 ...     {*cdate
0287 ...         09/06/2014 11:38
0288 ...     *}
0289 ... 
0290 ...     {*remark
0291 ...         The volume of a pyramid is exactly a third (1/3) of the volume of the
0292 ...         rectangular solid based on the same parameters
0293 ...     *}
0294 ... 
0295 ...     {*assert
0296 ...         MATH_Between( MATH_PyramidVolume( 5,5,10 ),83.33,83.34 )
0297 ...     *}
0298 ... 
0299 ...     {*exec
0300 ...         echo MATH_PyramidVolume( 5,5,10 );
0301 ...     *}
0302 ... 
0303 ...     {*seealso
0304 ...         MATH_RectangularVolume(), MATH_CubeVolume()
0305 ...     *}
0306 ... 
0307 ...     {*group volume *}
0308 ... 
0309 ...     *}}
0310 ...  */
0311 ... /* ========================================================================== */
0312 ... function MATH_PyramidVolume( $l,$w,$h )
0313 ... /*-----------------------------------*/
0314 ... {
0315 ...     return ( MATH_RectangularVolume( $l,$w,$h )  / 3 );
0316 ... }   /* End of function MATH_PyramidVolume() ================================= */
0317 ... 
0318 ... /* ========================================================================== */
0319 ... /** {{*MATH_CylinderVolume( $r,$h )=
0320 ... 
0321 ...     Calculates the volume of a sylinder
0322 ... 
0323 ...     {*params
0324 ...         $r  (float) radius of the base of the cylinder
0325 ...         $h  (float) height of the cylinder
0326 ...     *}
0327 ... 
0328 ...     {*return
0329 ...         (float)     Volume of the cylinder
0330 ...     *}
0331 ... 
0332 ...     {*version
0333 ...         6.0.0008
0334 ...     *}
0335 ... 
0336 ...     {*cdate
0337 ...         09/06/2014 12:20
0338 ...     *}
0339 ... 
0340 ...     {*warning
0341 ...         The result that is given back is an approximation given the
0342 ...         irrationality of Pi. Use [c]MATH_Between()[/c] for comparisons.
0343 ...     *}
0344 ... 
0345 ...     {*assert
0346 ...         MATH_Between( MATH_CylinderVolume( 5,10 ),785.398,786.399 )
0347 ...     *}
0348 ... 
0349 ...     {*exec
0350 ...         echo MATH_CylinderVolume( 5,10 );
0351 ...     *}
0352 ... 
0353 ...     {*group volume *}
0354 ... 
0355 ...     {*seealso
0356 ...         MATH_ConeVolume()
0357 ...     *}
0358 ... 
0359 ...     {*group volume *}
0360 ... 
0361 ...     *}}
0362 ...  */
0363 ... /* ========================================================================== */
0364 ... function MATH_CylinderVolume( $r,$h )
0365 ... /*---------------------------------*/
0366 ... {
0367 ...     return ( MATH_CircleArea( $r ) * $h );
0368 ... }   /* End of function MATH_CylinderVolume() ================================= */
0369 ... 
0370 ... /* ========================================================================== */
0371 ... /** {{*MATH_ConeVolume( $r,$h )=
0372 ... 
0373 ...     Calculates the volume of a cone
0374 ... 
0375 ...     {*params
0376 ...         $r  (float) radius of the base of the cone
0377 ...         $h  (float) height of the cone
0378 ...     *}
0379 ... 
0380 ...     {*return
0381 ...         (float)     Volume of the cone
0382 ...     *}
0383 ... 
0384 ...     {*version
0385 ...         6.0.0008
0386 ...     *}
0387 ... 
0388 ...     {*cdate
0389 ...         09/06/2014 11:38
0390 ...     *}
0391 ... 
0392 ...     {*remark
0393 ...         The volume of a cone is exactly a third (1/3) of the volume of the
0394 ...         cylinder having the same parameters
0395 ...     *}
0396 ... 
0397 ...     {*assert
0398 ...         MATH_Between( MATH_ConeVolume( 5,10 ),261.799,261.800 )
0399 ...     *}
0400 ... 
0401 ...     {*exec
0402 ...         echo MATH_ConeVolume( 5,10 );
0403 ...     *}
0404 ... 
0405 ...     {*seealso
0406 ...         MATH_RectangularVolume(), MATH_CubeVolume(), MATH_SphereVolume(),
0407 ...         MATH_CylinderVolume(), MATH_ConeArea()
0408 ...     *}
0409 ... 
0410 ...     {*group volume *}
0411 ... 
0412 ...     *}}
0413 ...  */
0414 ... /* ========================================================================== */
0415 ... function MATH_ConeVolume( $r,$h )
0416 ... /*-----------------------------*/
0417 ... {
0418 ...     return ( MATH_CylinderVolume( $r,$h ) / 3 );
0419 ... }   /* End of function MATH_ConeVolume() ================================= */
0420 ... 
0421 ... /* ========================================================================== */
0422 ... /** {{*MATH_RectangleArea( $l,$w )=
0423 ... 
0424 ...     Calculates the area of a rectangle
0425 ... 
0426 ...     {*params
0427 ...         $l  (float) length of the rectangle
0428 ...         $w  (float) width of the rectangle
0429 ...     *}
0430 ... 
0431 ...     {*return
0432 ...         (float)     Area of the rectangle
0433 ...     *}
0434 ... 
0435 ...     {*version
0436 ...         6.0.0008
0437 ...     *}
0438 ... 
0439 ...     {*cdate
0440 ...         09/06/2014 11:58
0441 ...     *}
0442 ... 
0443 ...     {*assert
0444 ...         MATH_RectangleArea( 5,10 ) === (float) 50
0445 ...     *}
0446 ... 
0447 ...     {*group area *}
0448 ... 
0449 ...     {*seealso
0450 ...         MATH_SquareArea(), MATH_RectangularVolume()
0451 ...     *}
0452 ... 
0453 ...     *}}
0454 ...  */
0455 ... /* ========================================================================== */
0456 ... function MATH_RectangleArea( $l,$w )
0457 ... /*--------------------------------*/
0458 ... {
0459 ...     return ( (float) $l * $w );
0460 ... }   /* End of function MATH_RectangleArea() ================================= */
0461 ... 
0462 ... /* ========================================================================== */
0463 ... /** {{*MATH_SquareArea( $a )=
0464 ... 
0465 ...     Calculates the area of a square
0466 ... 
0467 ...     {*params
0468 ...         $a  (float) side of the square
0469 ...     *}
0470 ... 
0471 ...     {*return
0472 ...         (float)     Area of the square
0473 ...     *}
0474 ... 
0475 ...     {*version
0476 ...         6.0.0008
0477 ...     *}
0478 ... 
0479 ...     {*cdate
0480 ...         09/06/2014 12:00
0481 ...     *}
0482 ... 
0483 ...     {*assert
0484 ...         MATH_SquareArea( 5 ) === (float) 25
0485 ...     *}
0486 ... 
0487 ...     {*group area *}
0488 ... 
0489 ...     {*seealso
0490 ...         MATH_ReactangleArea(), MATH_CubeVolume(), MATH_CircleArea()
0491 ...     *}
0492 ... 
0493 ...     *}}
0494 ...  */
0495 ... /* ========================================================================== */
0496 ... function MATH_SquareArea( $a )
0497 ... /*--------------------------*/
0498 ... {
0499 ...     return ( MATH_RectangleArea( $a,$a ) );
0500 ... }   /* End of function MATH_SquareArea() ==================================== */
0501 ... 
0502 ... /* ========================================================================== */
0503 ... /** {{*MATH_TrapezeArea( $b1,$b2,$h )=
0504 ... 
0505 ...     Calculates the area of a trapezoid
0506 ... 
0507 ...     {*params
0508 ...         $b1 (float) base1 of the trapezoid
0509 ...         $b2 (float) base2 of the trapezoid
0510 ...         $h  (float) height of the trapezoid
0511 ...     *}
0512 ... 
0513 ...     {*return
0514 ...         (float)     Area of the trapezoid
0515 ...     *}
0516 ... 
0517 ...     {*version
0518 ...         6.0.0008
0519 ...     *}
0520 ... 
0521 ...     {*cdate
0522 ...         09/06/2014 16:18
0523 ...     *}
0524 ... 
0525 ...     {*assert
0526 ...         MATH_TrapezeArea( 10,10,10 ) === (float) 100
0527 ...     *}
0528 ... 
0529 ...     {*assert
0530 ...         MATH_TrapezeArea( 5,10,10 ) === (float) 75
0531 ...     *}
0532 ... 
0533 ...     {*group area *}
0534 ... 
0535 ...     {*seealso
0536 ...         MATH_RectangleArea()
0537 ...     *}
0538 ... 
0539 ...     *}}
0540 ...  */
0541 ... /* ========================================================================== */
0542 ... function MATH_TrapezeArea( $b1,$b2,$h )
0543 ... /*-----------------------------------*/
0544 ... {
0545 ...     return ( (float) ( ( $b1 + $b2 ) * $h ) / 2 );
0546 ... }   /* End of function MATH_TrapezeArea() =================================== */
0547 ... 
0548 ... /* ========================================================================== */
0549 ... /** {{*MATH_TriangleArea( $b,$h )=
0550 ... 
0551 ...     Calculates the area of a triangle
0552 ... 
0553 ...     {*params
0554 ...         $b  (float) base of the triangle
0555 ...         $h  (float) height of the triangle
0556 ...     *}
0557 ... 
0558 ...     {*return
0559 ...         (float)     Area of the triangle
0560 ...     *}
0561 ... 
0562 ...     {*version
0563 ...         6.0.0008
0564 ...     *}
0565 ... 
0566 ...     {*cdate
0567 ...         09/06/2014 16:23
0568 ...     *}
0569 ... 
0570 ...     {*assert
0571 ...         MATH_TriangleArea( 10,7 ) === (float) 35
0572 ...     *}
0573 ... 
0574 ...     {*group area *}
0575 ... 
0576 ...     {*seealso
0577 ...         MATH_RectangleArea(), MATH_TrapezeArea()
0578 ...     *}
0579 ... 
0580 ...     *}}
0581 ...  */
0582 ... /* ========================================================================== */
0583 ... function MATH_TriangleArea( $b,$h )
0584 ... /*-----------------------------------*/
0585 ... {
0586 ...     return ( (float) ( $b * $h ) / 2 );
0587 ... }   /* End of function MATH_TriangleArea() =================================== */
0588 ... 
0589 ... 
0590 ... /* ========================================================================== */
0591 ... /** {{*MATH_DiamondArea( $d1,$d2 )=
0592 ... 
0593 ...     Calculates the area of a diamond
0594 ... 
0595 ...     {*params
0596 ...         $d1 (float) diagonal 1 of the diamond
0597 ...         $d2 (float) diagonal 2 of the diamond
0598 ...     *}
0599 ... 
0600 ...     {*return
0601 ...         (float)     Area of the diamond (lozenge)
0602 ...     *}
0603 ... 
0604 ...     {*version
0605 ...         6.0.0008
0606 ...     *}
0607 ... 
0608 ...     {*cdate
0609 ...         09/06/2014 16:23
0610 ...     *}
0611 ... 
0612 ...     {*assert
0613 ...         MATH_DiamondArea( 10,5 ) === (float) 25
0614 ...     *}
0615 ... 
0616 ...     {*group area *}
0617 ... 
0618 ...     {*seealso
0619 ...         MATH_ParallelogramArea()
0620 ...     *}
0621 ... 
0622 ...     *}}
0623 ...  */
0624 ... /* ========================================================================== */
0625 ... function MATH_DiamondArea( $d1,$d2 )
0626 ... /*--------------------------------*/
0627 ... {
0628 ...     return ( (float) ( $d1 * $d2 ) / 2 );
0629 ... }   /* End of function MATH_DiamondArea() =================================== */
0630 ... 
0631 ... /* ========================================================================== */
0632 ... /** {{*MATH_SectorArea( $r,$theta )=
0633 ... 
0634 ...     Calculates the area of the $theta sector of a circle with the $r radius
0635 ... 
0636 ...     {*params
0637 ...         $r      (float) radius of the circle
0638 ...         $theta  (float) angle in [b]radians[/b]
0639 ...     *}
0640 ... 
0641 ...     {*return
0642 ...         (float)     Area of the sector of a circle of radius $r, angle $theta
0643 ...     *}
0644 ... 
0645 ...     {*version
0646 ...         6.0.0008
0647 ...     *}
0648 ... 
0649 ...     {*cdate
0650 ...         09/06/2014 16:31
0651 ...     *}
0652 ... 
0653 ...     {*assert
0654 ...         MATH_SectorArea2( 5,90 ) === MATH_SectorArea( 5,deg2rad( 90 ) )
0655 ...     *}
0656 ... 
0657 ...     {*assert
0658 ...         MATH_SectorArea2( 5,90 ) === ( MATH_CircleArea( 5 ) / 4 )
0659 ...     *}
0660 ... 
0661 ...     {*group area *}
0662 ... 
0663 ...     {*seealso
0664 ...         MATH_SectorArea2()
0665 ...     *}
0666 ... 
0667 ...     *}}
0668 ...  */
0669 ... /* ========================================================================== */
0670 ... function MATH_SectorArea( $r,$theta )
0671 ... /*---------------------------------*/
0672 ... {
0673 ...     return ( (float) ( $theta / 2 ) * ( $r * $r ) );
0674 ... }   /* End of function MATH_SectorArea() ==================================== */
0675 ... 
0676 ... /* ========================================================================== */
0677 ... /** {{*MATH_SectorArea2( $r,$angle )=
0678 ... 
0679 ...     Calculates the area of the $angle sector of a circle with the $r radius
0680 ... 
0681 ...     {*params
0682 ...         $r      (float) radius of the circle
0683 ...         $angle  (float) angle in [b]degrees[/b]
0684 ...     *}
0685 ... 
0686 ...     {*return
0687 ...         (float)     Area of the sector of a circle of radius $r, angle $angle
0688 ...     *}
0689 ... 
0690 ...     {*version
0691 ...         6.0.0008
0692 ...     *}
0693 ... 
0694 ...     {*cdate
0695 ...         09/06/2014 18:57
0696 ...     *}
0697 ... 
0698 ...     {*assert
0699 ...         MATH_Between( MATH_SectorArea2( 5,90 ),19.634,19.635 )
0700 ...     *}
0701 ... 
0702 ...     {*group area *}
0703 ... 
0704 ...     {*seealso
0705 ...         MATH_SectorArea()
0706 ...     *}
0707 ... 
0708 ...     *}}
0709 ...  */
0710 ... /* ========================================================================== */
0711 ... function MATH_SectorArea2( $r,$angle )
0712 ... /*----------------------------------*/
0713 ... {
0714 ...     return ( MATH_CircleArea( $r ) * ( $angle / 360 ) );
0715 ... }   /* End of function MATH_SectorArea2() =================================== */
0716 ... 
0717 ... /* ========================================================================== */
0718 ... /** {{*MATH_PyramidArea( $b,$h )=
0719 ... 
0720 ...     Calculates the area of the pyramid
0721 ... 
0722 ...     {*params
0723 ...         $b  (float) base of the pyramid
0724 ...         $h  (float) height of the pyramid
0725 ...     *}
0726 ... 
0727 ...     {*return
0728 ...         (float)     Area of the pyramid (4 triangles + base)
0729 ...     *}
0730 ... 
0731 ...     {*version
0732 ...         6.0.0008
0733 ...     *}
0734 ... 
0735 ...     {*cdate
0736 ...         10/06/2014 06:09
0737 ...     *}
0738 ... 
0739 ...     {*assert
0740 ...         MATH_Between( MATH_PyramidArea( 5,10 ),128.077,128.078 )
0741 ...     *}
0742 ... 
0743 ...     {*exec
0744 ...         echo MATH_PyramidArea( 5,10 );
0745 ...     *}
0746 ... 
0747 ...     {*group area *}
0748 ... 
0749 ...     {*seealso
0750 ...         MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(),
0751 ...         MATH_TriangleArea(), MATH_TrapezeArea()
0752 ...     *}
0753 ... 
0754 ...     *}}
0755 ...  */
0756 ... /* ========================================================================== */
0757 ... function MATH_PyramidArea( $b,$h )
0758 ... /*------------------------------*/
0759 ... {
0760 ...     $fBaseArea = $b * $b;
0761 ...     $fSlant    = sqrt( ( $h * $h ) + pow( $b / 2,2 ) );
0762 ...     $fTrianglesArea = $fSlant * $b * 2;
0763 ... 
0764 ...     return ( (float) $fBaseArea + $fTrianglesArea );
0765 ... }   /* End of function MATH_PyramidArea() =================================== */
0766 ... 
0767 ... /* ========================================================================== */
0768 ... /** {{*MATH_CubeArea( $b )=
0769 ... 
0770 ...     Calculates the area of a cube
0771 ... 
0772 ...     {*params
0773 ...         $b  (float) base of the cube
0774 ...     *}
0775 ... 
0776 ...     {*return
0777 ...         (float)     Area of the cube
0778 ...     *}
0779 ... 
0780 ...     {*version
0781 ...         6.0.0008
0782 ...     *}
0783 ... 
0784 ...     {*cdate
0785 ...         10/06/2014 06:14
0786 ...     *}
0787 ... 
0788 ...     {*assert
0789 ...         MATH_CubeArea( 5 ) === (float) 150
0790 ...     *}
0791 ... 
0792 ...     {*group area *}
0793 ... 
0794 ...     {*seealso
0795 ...         MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(),
0796 ...         MATH_TriangleArea(), MATH_TrapezeArea()
0797 ...     *}
0798 ... 
0799 ...     *}}
0800 ...  */
0801 ... /* ========================================================================== */
0802 ... function MATH_CubeArea( $b )
0803 ... /*------------------------*/
0804 ... {
0805 ...     return ( (float) ( $b * $b ) * 6 );
0806 ... }   /* End of function MATH_CubeArea() ====================================== */
0807 ... 
0808 ... /* ========================================================================== */
0809 ... /** {{*MATH_ConeArea( $r,$h,$bWithBase )=
0810 ... 
0811 ...     Calculates the area of a cone
0812 ... 
0813 ...     {*params
0814 ...         $r          (float) radius of the cone
0815 ...         $h          (float) height of the cone
0816 ...         $bWithBase  (bool)  include base area. Optional: [c]true[/c] by default.
0817 ...     *}
0818 ... 
0819 ...     {*return
0820 ...         (float)     Area of the cone
0821 ...     *}
0822 ... 
0823 ...     {*version
0824 ...         6.0.0008
0825 ...     *}
0826 ... 
0827 ...     {*cdate
0828 ...         10/06/2014 06:20
0829 ...     *}
0830 ... 
0831 ...     {*assert
0832 ...         MATH_Between( MATH_ConeArea( 5,10 ),254.16,254.17 )
0833 ...     *}
0834 ... 
0835 ...     {*assert
0836 ...         MATH_Between( MATH_ConeArea( 5,10,false ),175.62,175.63 )
0837 ...     *}
0838 ... 
0839 ...     {*group area *}
0840 ... 
0841 ...     {*exec
0842 ...         echo MATH_ConeArea( 5,10 );
0843 ...     *}
0844 ... 
0845 ...     {*seealso
0846 ...         MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(),
0847 ...         MATH_TriangleArea(), MATH_TrapezeArea(), MATH_ConeVolume()
0848 ...     *}
0849 ... 
0850 ...     *}}
0851 ...  */
0852 ... /* ========================================================================== */
0853 ... function MATH_ConeArea( $r,$h,$bWithBase = true )
0854 ... /*---------------------------------------------*/
0855 ... {
0856 ...     return ( (float) pi() * $r * ( sqrt( ( $r * $r ) + ( $h * $h ) ) ) + ( $bWithBase ? ( pi() * ( $r * $r ) ) : 0 ) );
0857 ... }   /* End of function MATH_ConeArea() ====================================== */
0858 ... 
0859 ... /* ========================================================================== */
0860 ... /** {{*MATH_CylinderArea( $r,$h )=
0861 ... 
0862 ...     Calculates the area of a sylinder
0863 ... 
0864 ...     {*params
0865 ...         $r  (float) radius of the base of the cylinder
0866 ...         $h  (float) height of the cylinder
0867 ...     *}
0868 ... 
0869 ...     {*return
0870 ...         (float)     Area of the cylinder
0871 ...     *}
0872 ... 
0873 ...     {*version
0874 ...         6.0.0008
0875 ...     *}
0876 ... 
0877 ...     {*cdate
0878 ...         10/06/2014 07:56
0879 ...     *}
0880 ... 
0881 ...     {*warning
0882 ...         The result that is given back is an approximation given the
0883 ...         irrationality of Pi. Use [c]MATH_Between()[/c] for comparisons.
0884 ...     *}
0885 ... 
0886 ...     {*assert
0887 ...         MATH_Between( MATH_CylinderArea( 5,10 ),314,315 )
0888 ...     *}
0889 ... 
0890 ...     {*exec
0891 ...         echo MATH_CylinderArea( 5,10 );
0892 ...     *}
0893 ... 
0894 ...     {*group area *}
0895 ... 
0896 ...     {*seealso
0897 ...         MATH_CylinderVolume(), MATH_ConeArea(), MATH_TrapezeArea(),
0898 ...         MATH_TriangleArea(), MATH_RectangleArea()
0899 ...     *}
0900 ... 
0901 ...     {*group volume *}
0902 ... 
0903 ...     *}}
0904 ...  */
0905 ... /* ========================================================================== */
0906 ... function MATH_CylinderArea( $r,$h )
0907 ... /*-------------------------------*/
0908 ... {
0909 ...     return ( MATH_RectangleArea( $h,MATH_CirclePerimeter( $r ) ) );
0910 ... }   /* End of function MATH_CylinderArea() ================================== */
0911 ... 
0912 ... /* ========================================================================== */
0913 ... /** {{*MATH_CirclePerimeter( $r )=
0914 ... 
0915 ...     Calculates the perimeter of a circle
0916 ... 
0917 ...     {*params
0918 ...         $r  (float) radius of the circle
0919 ...     *}
0920 ... 
0921 ...     {*return
0922 ...         (float)     Perimeter of the circle
0923 ...     *}
0924 ... 
0925 ...     {*version
0926 ...         6.0.0008
0927 ...     *}
0928 ... 
0929 ...     {*cdate
0930 ...         10/06/2014 07:59
0931 ...     *}
0932 ... 
0933 ...     {*warning
0934 ...         The result that is given back is an approximation given the
0935 ...         irrationality of Pi. Use [c]MATH_Between()[/c] for comparisons.
0936 ...     *}
0937 ... 
0938 ...     {*assert
0939 ...         MATH_Between( MATH_CirclePerimeter( 5 ),31.415,31.416 )
0940 ...     *}
0941 ... 
0942 ...     {*exec
0943 ...         echo MATH_CirclePerimeter( 5 );
0944 ...     *}
0945 ... 
0946 ...     {*group perimeter *}
0947 ... 
0948 ...     {*seealso
0949 ...         MATH_RectanglePerimeter()
0950 ...     *}
0951 ... 
0952 ...     {*group volume *}
0953 ... 
0954 ...     *}}
0955 ...  */
0956 ... /* ========================================================================== */
0957 ... function MATH_CirclePerimeter( $r )
0958 ... /*-------------------------------*/
0959 ... {
0960 ...     return ( (float) ( 2 * pi() * $r ) );
0961 ... }   /* End of function MATH_CirclePerimeter() =============================== */
0962 ... 
0963 ... /* ========================================================================== */
0964 ... /** {{*MATH_RectanglePerimeter( $l,$w )=
0965 ... 
0966 ...     Calculates the perimeter of a rectangle
0967 ... 
0968 ...     {*params
0969 ...         $l  (float) length of the rectangle
0970 ...         $w  (float) width of the rectangle
0971 ...     *}
0972 ... 
0973 ...     {*return
0974 ...         (float)     Perimeter of the rectangle
0975 ...     *}
0976 ... 
0977 ...     {*version
0978 ...         6.0.0008
0979 ...     *}
0980 ... 
0981 ...     {*cdate
0982 ...         10/06/2014 08:11
0983 ...     *}
0984 ... 
0985 ...     {*assert
0986 ...         MATH_RectanglePerimeter( 5,10 ) === (float) 30
0987 ...     *}
0988 ... 
0989 ...     {*group perimeter *}
0990 ... 
0991 ...     {*seealso
0992 ...         MATH_CirclePerimeter(), MATH_SquarePerimeter()
0993 ...     *}
0994 ... 
0995 ...     *}}
0996 ...  */
0997 ... /* ========================================================================== */
0998 ... function MATH_RectanglePerimeter( $l,$w )
0999 ... /*-------------------------------------*/
1000 ... {
1001 ...     return ( (float) ( $l + $w ) * 2 );
1002 ... }   /* End of function MATH_RectanglePerimeter() ============================ */
1003 ... 
1004 ... /* ========================================================================== */
1005 ... /** {{*MATH_SquarePerimeter( $a )=
1006 ... 
1007 ...     Calculates the perimeter of a square
1008 ... 
1009 ...     {*params
1010 ...         $a  (float) side of the square
1011 ...     *}
1012 ... 
1013 ...     {*return
1014 ...         (float)     Perimeter of the rectangle
1015 ...     *}
1016 ... 
1017 ...     {*version
1018 ...         6.0.0008
1019 ...     *}
1020 ... 
1021 ...     {*cdate
1022 ...         10/06/2014 08:11
1023 ...     *}
1024 ... 
1025 ...     {*assert
1026 ...         MATH_SquarePerimeter( 5 ) === (float) 20
1027 ...     *}
1028 ... 
1029 ...     {*group perimeter *}
1030 ... 
1031 ...     {*seealso
1032 ...         MATH_CirclePerimeter(), MATH_RectanglePerimeter()
1033 ...     *}
1034 ... 
1035 ...     *}}
1036 ...  */
1037 ... /* ========================================================================== */
1038 ... function MATH_SquarePerimeter( $a )
1039 ... /*-------------------------------*/
1040 ... {
1041 ...     return ( MATH_RectanglePerimeter( $a,$a ) );
1042 ... }   /* End of function MATH_SquarePerimeter() =============================== */
1043 ... 
1044 ... /* ========================================================================== */
1045 ... /** {{*MATH_TrianglePerimeter( $a,$b,$c )=
1046 ... 
1047 ...     Calculates the perimeter of a triangle
1048 ... 
1049 ...     {*params
1050 ...         $a  (float) side a of the triangle
1051 ...         $b  (float) side b of the triangle
1052 ...         $c  (float) side c of the triangle
1053 ...     *}
1054 ... 
1055 ...     {*return
1056 ...         (float)     Perimeter of the triangle
1057 ...     *}
1058 ... 
1059 ...     {*version
1060 ...         6.0.0008
1061 ...     *}
1062 ... 
1063 ...     {*cdate
1064 ...         10/06/2014 08:11
1065 ...     *}
1066 ... 
1067 ...     {*assert
1068 ...         MATH_TrianglePerimeter( 5,4,4 ) === (float) 13
1069 ...     *}
1070 ... 
1071 ...     {*group perimeter *}
1072 ... 
1073 ...     {*seealso
1074 ...         MATH_CirclePerimeter(), MATH_RectanglePerimeter()
1075 ...     *}
1076 ... 
1077 ...     *}}
1078 ...  */
1079 ... /* ========================================================================== */
1080 ... function MATH_TrianglePerimeter( $a,$b,$c )
1081 ... /*---------------------------------------*/
1082 ... {
1083 ...     return ( (float) $a + $b + $c );
1084 ... }   /* End of function MATH_TrianglePerimeter() ============================= */
1085 ... 
1086 ... function MATH_IsoscelesTrianglePerimeter( $a,$b )
1087 ... /*---------------------------------------------*/
1088 ... {
1089 ...     return ( MATH_TrianglePerimeter( $a,$a,$b ) );
1090 ... }
1091 ... 
1092 ... function MATH_IsoscelesTrianglePerimeter2( $b,$h )
1093 ... /*----------------------------------------------*/
1094 ... {
1095 ...     $a = sqrt( pow( $b / 2,2 ) + ( $h * $h ) );
1096 ...     return ( MATH_TrianglePerimeter( $a,$a,$b ) );
1097 ... }
1098 ... 
1099 ... function MATH_EquilateralTrianglePerimeter( $a )
1100 ... /*---------------------------------------------*/
1101 ... {
1102 ...     return ( MATH_TrianglePerimeter( $a,$a,$a ) );
1103 ... }
1104 ... 
1105 ... /* ========================================================================== */
1106 ... /** {{*MATH_DiamondPerimeter( $d1,$d2 )=
1107 ... 
1108 ...     Calculates the perimeter of a diamond
1109 ... 
1110 ...     {*params
1111 ...         $d1 (float) diagonal 1 of the diamond
1112 ...         $d2 (float) diagonal 2 of the diamond
1113 ...     *}
1114 ... 
1115 ...     {*return
1116 ...         (float)     Perimeter of the diamond (lozenge)
1117 ...     *}
1118 ... 
1119 ...     {*cdate
1120 ...         09/06/2014 11:02
1121 ...     *}
1122 ... 
1123 ...     {*version
1124 ...         6.0.0008
1125 ...     *}
1126 ... 
1127 ...     {*author  *}
1128 ... 
1129 ...     {*warning
1130 ...         Use comparisons with great care as the result is given back as a float
1131 ...     *}
1132 ... 
1133 ...     {*assert
1134 ...         MATH_DiamondPerimeter( 6,8 ) === (float) 20
1135 ...     *}
1136 ... 
1137 ...     {*group perimeter *}
1138 ... 
1139 ...     *}}
1140 ...  */
1141 ... /* ========================================================================== */
1142 ... function MATH_DiamondPerimeter( $d1,$d2 )
1143 ... /*-------------------------------------*/
1144 ... {
1145 ...     $hyp = MATH_Hypotenuse( $d1 / 2,$d2 / 2 );
1146 ... 
1147 ...     return ( (float) ( $hyp * 4 ) );
1148 ... }   /* End of function MATH_DiamondPerimeter() ============================== */
1149 ... 
1150 ... /* ========================================================================== */
1151 ... /** {{*MATH_Hypotenuse( $a,$b )=
1152 ... 
1153 ...     Calculates the hypotenuse of 2 sides
1154 ... 
1155 ...     {*params
1156 ...         $a (float) side 1 of the hypotenuse
1157 ...         $b (float) side 2 of the hypotenuse
1158 ...     *}
1159 ... 
1160 ...     {*return
1161 ...         (float)     Hypotenuse of 2 sides
1162 ...     *}
1163 ... 
1164 ...     {*cdate
1165 ...         10/06/2014 08:12
1166 ...     *}
1167 ... 
1168 ...     {*version
1169 ...         6.0.0008
1170 ...     *}
1171 ... 
1172 ...     {*author  *}
1173 ... 
1174 ...     {*assert
1175 ...         MATH_Hypotenuse( 3,4 ) === (float) 5
1176 ...     *}
1177 ... 
1178 ...     {*group geometry *}
1179 ... 
1180 ...     *}}
1181 ...  */
1182 ... /* ========================================================================== */
1183 ... function MATH_Hypotenuse( $a,$b )
1184 ... /*-----------------------------*/
1185 ... {
1186 ...     return ( (float) sqrt( ( $a * $a ) + ( $b * $b ) ) );
1187 ... }
1188 ... 
1189 ... function MATH_ParallelogramArea( $b,$h )
1190 ... /*------------------------------------*/
1191 ... {
1192 ...     return ( MATH_RectangleArea( $b,$h ) );
1193 ... }   /* End of function MATH_ParallelogramArea() ============================= */
1194 ... 
1195 ... /* ========================================================================== */
1196 ... /** {{*MATH_EllipseArea( $r1,$r2 )=
1197 ... 
1198 ...     Calculates the area of an ellipse
1199 ... 
1200 ...     {*params
1201 ...         $r1     (float) semi-minor axis
1202 ...         $r2     (float) semi-major axis
1203 ...     *}
1204 ... 
1205 ...     {*return
1206 ...         (float)     Area of the sector of the ellipse
1207 ...     *}
1208 ... 
1209 ...     {*version
1210 ...         6.0.0008
1211 ...     *}
1212 ... 
1213 ...     {*cdate
1214 ...         09/06/2014 16:57
1215 ...     *}
1216 ... 
1217 ...     {*
1218 ...     {*assert
1219 ...         MATH_Between( MATH_EllipseArea( 10,5 ),157.07,157.08 )
1220 ...     *}
1221 ... 
1222 ...     {*group area *}
1223 ... 
1224 ...     {*seealso
1225 ...         MATH_RectangleArea(), MATH_TrapezeArea(), MATH_DiamondArea()
1226 ...     *}
1227 ... 
1228 ...     *}}
1229 ...  */
1230 ... /* ========================================================================== */
1231 ... function MATH_EllipseArea( $r1,$r2 )
1232 ... /*--------------------------------*/
1233 ... {
1234 ...     return ( $r1 * $r2 * pi() );
1235 ... }   /* End of function MATH_EllipseArea() =================================== */
1236 ... 
1237 ... /* ========================================================================== */
1238 ... /** {{*MATH_EllipseVolume( $r1,$r2,$r3 )=
1239 ... 
1240 ...     Calculates the volume of an ellipse
1241 ... 
1242 ...     {*params
1243 ...         $r1     (float) semi-axis A
1244 ...         $r2     (float) semi-axis B
1245 ...         $r3     (float) semi-axis C
1246 ...     *}
1247 ... 
1248 ...     {*return
1249 ...         (float)     Volume of the ellipse
1250 ...     *}
1251 ... 
1252 ...     {*version
1253 ...         6.0.0008
1254 ...     *}
1255 ... 
1256 ...     {*cdate
1257 ...         09/06/2014 17:01
1258 ...     *}
1259 ... 
1260 ...     {*
1261 ...     {*assert
1262 ...         MATH_Between( MATH_EllipseVolume( 10,5,7 ),1466.07,1466.08 )
1263 ...     *}
1264 ... 
1265 ...     {*group volume *}
1266 ... 
1267 ...     {*seealso
1268 ...         MATH_SphereVolume()
1269 ...     *}
1270 ... 
1271 ...     *}}
1272 ...  */
1273 ... /* ========================================================================== */
1274 ... function MATH_EllipseVolume( $r1,$r2,$r3 )
1275 ... /*--------------------------------------*/
1276 ... {
1277 ...     return ( $r1 * $r2 * $r3 * pi() * 4 / 3 );
1278 ... }   /* End of function MATH_EllipseVolume() ================================= */
1279 ... 
1280 ... /* ========================================================================== */
1281 ... /** {{*MATH_CircleArea( $r )=
1282 ... 
1283 ...     Calculates the area of a circle
1284 ... 
1285 ...     {*params
1286 ...         $ra  (float) radius of the circle
1287 ...     *}
1288 ... 
1289 ...     {*return
1290 ...         (float)     Area of the circle
1291 ...     *}
1292 ... 
1293 ...     {*remark
1294 ...         Formula: Pi x r[sup]2[/sup]
1295 ...     *}
1296 ... 
1297 ...     {*version
1298 ...         6.0.0008
1299 ...     *}
1300 ... 
1301 ...     {*cdate
1302 ...         09/06/2014 12:01
1303 ...     *}
1304 ... 
1305 ...     {*assert
1306 ...         MATH_Between( MATH_CircleArea( 5 ),78,79 )
1307 ...     *}
1308 ... 
1309 ...     {*seealso
1310 ...         MATH_SphereVolume()
1311 ...     *}
1312 ... 
1313 ...     {*group area *}
1314 ... 
1315 ...     *}}
1316 ...  */
1317 ... /* ========================================================================== */
1318 ... function MATH_CircleArea( $r )
1319 ... /*--------------------------*/
1320 ... {
1321 ...     return ( pi() * MATH_SquareArea( $r ) );
1322 ... }   /* End of function MATH_CircleArea() ==================================== */
1323 ... 
1324 ... 
1325 ... /* ========================================================================== */
1326 ... /** {{*MATH_Credit( $C,$n,$t )=
1327 ... 
1328 ...     Calculates the monthly amount of a credit whose capital is $C, duration
1329 ...     $n months at an annual rate of $t
1330 ... 
1331 ...     {*params
1332 ...         $C  (int)   Amount to borrow
1333 ...         $n  (int)   Number of months
1334 ...         $t  (float) Annual rate (all fees included) (APRC - Annual Percentage Rate of Charge)
1335 ...     *}
1336 ... 
1337 ...     {*warning
1338 ...         This should be found in Finance functions
1339 ...     *}
1340 ... 
1341 ...     {*doc       [url]http://www.ilemaths.net/calcul-credit.php[/url]
1342 ...     *}
1343 ... 
1344 ...     {*cdate
1345 ...         08/01/2013 08:22
1346 ...     *}
1347 ... 
1348 ...     {*version
1349 ...         5.0.0011
1350 ...     *}
1351 ... 
1352 ...     {*return
1353 ...         (float) Monthly amount to be paid
1354 ...     *}
1355 ... 
1356 ...     {*exec
1357 ...         $C = 5000;
1358 ...         $n = 48;
1359 ...         $t = 5.09;
1360 ... 
1361 ...         echo '<p>',number_format( MATH_Credit( $C,$n,$t ),2,',','.' ),' EUR</p>';
1362 ...     *}
1363 ... 
1364 ...     *}}
1365 ...  */
1366 ... /* ====================================================================== */
1367 ... function MATH_Credit( $C,$n,$t )
1368 ... /*----------------------------*/
1369 ... {
1370 ...     $t /= 100;
1371 ...     return ( (float) round( ( $C * ( $t / 12 ) ) / ( 1 - pow( ( 1 + ( $t / 12 ) ),-$n )  ),4 ) );
1372 ... }   /* End of function MATH_Credit() ==================================== */
1373 ... 
1374 ... /* ====================================================================== */
1375 ... /** {{*MATH_Mean( $a )=
1376 ... 
1377 ...     Returns the average of a set of numbers.
1378 ... 
1379 ...     {*params
1380 ...         $a  (array)     Array of numbers
1381 ...     *}
1382 ... 
1383 ...     {*cdate
1384 ...         30/07/2013 07:40
1385 ...     *}
1386 ... 
1387 ...     {*version
1388 ...         5.4.0010
1389 ...     *}
1390 ... 
1391 ...     {*return
1392 ...         (float) Average of $a or [c]null[/c] if average cannot be
1393 ...                 calculated.
1394 ...     *}
1395 ... 
1396 ...     {*exec
1397 ...         $a = array( 1,2,3,4,5 );
1398 ...         echo '<p>',MATH_Mean($a),'</p>';
1399 ... 
1400 ...         $a = array();
1401 ...         if ( is_null( MATH_Mean( $a ) ) )
1402 ...         {
1403 ...             echo '<p>Undefined result</p>';
1404 ...         }
1405 ...     *}
1406 ... 
1407 ...     {*assert MATH_Mean( array( 1,2,3,4,5 ) ) === 3 *}
1408 ...     {*assert is_null( MATH_Mean() ) *}
1409 ...     {*assert is_null( MATH_Mean( array() ) ) *}
1410 ...     {*assert is_null( MATH_Mean( true ) ) *}
1411 ... 
1412 ...     {*seealso
1413 ...         MATH_Median(), MATH_Variance(), MATH_StandardDeviation()
1414 ...     *}
1415 ... 
1416 ...     {*group stats *}
1417 ... 
1418 ...     *}}
1419 ...  */
1420 ... /* ====================================================================== */
1421 ... function MATH_mean( $a = null )
1422 ... /*---------------------------*/
1423 ... {
1424 ...     $fResult = 0.0;                                                 /* Return value of the function */
1425 ... 
1426 ...     if ( is_array( $a ) )
1427 ...     {
1428 ...         $fSum    = array_sum( $a );                                 /* Sum the elements */
1429 ...         $iCount  = count( $a );                                     /* Count the number of elements */
1430 ... 
1431 ...         if ( $iCount !== 0 )
1432 ...         {
1433 ...             $fResult = $fSum / $iCount;                             /* Calculate average */
1434 ...         }   /* if ( $iCount !== 0 ) */
1435 ...         else   /* Else of ... if ( $iCount !== 0 ) */
1436 ...         {
1437 ...             $fResult = null;                                        /* Ready to freturn an undefined result */
1438 ...         }   /* End of ... Else of ... if ( $iCount !== 0 ) */
1439 ...     }
1440 ...     else
1441 ...     {
1442 ...         $fResult = null;                                            /* Ready to freturn an undefined result */
1443 ...     }
1444 ... 
1445 ...     return ( $fResult );                                            /* Return result to caller */
1446 ... }   /* End of function MATH_Mean() ====================================== */
1447 ... 
1448 ... /* ====================================================================== */
1449 ... /** {{*MATH_Median( $a )=
1450 ... 
1451 ...     Returns the median of a set of numbers. If odd number of elements,
1452 ...     the median is the middle number. If even, median is the mean of the
1453 ...     two middle numbers.
1454 ... 
1455 ...     {*params
1456 ...         $a  (array)     Array of numbers
1457 ...     *}
1458 ... 
1459 ...     {*cdate
1460 ...         30/07/2013 08:37
1461 ...     *}
1462 ... 
1463 ...     {*version
1464 ...         5.4.0010
1465 ...     *}
1466 ... 
1467 ...     {*return
1468 ...         (float) Median of $a or [c]null[/c] if median cannot be
1469 ...                 calculated.
1470 ...     *}
1471 ... 
1472 ...     {*exec
1473 ...         $a = array( 1,2,3,4,5 );
1474 ...         echo '<p>',MATH_Median($a),'</p>';
1475 ... 
1476 ...         $a = array( 4,3,5,1,2 );
1477 ...         echo '<p>',MATH_Median($a),'</p>';
1478 ... 
1479 ...         $a = array( 1 );
1480 ...         echo '<p>',MATH_Median($a),'</p>';
1481 ... 
1482 ...         $a = array( 12,48,73,18,4,108,451 );
1483 ...         echo '<p>',MATH_Median($a),'</p>';
1484 ... 
1485 ...         $a = array( 12,48,73,18,4,108,451,2 );
1486 ...         echo '<p>',MATH_Median($a),'</p>';
1487 ...     *}
1488 ... 
1489 ...     {*seealso
1490 ...         MATH_Mean(), MATH_Variance(), MATH_StandardDeviation()
1491 ...     *}
1492 ... 
1493 ...     {*assert
1494 ...         MATH_Median( array( 4,3,5,1,2 ) ) === 3
1495 ...     *}
1496 ... 
1497 ...     {*assert
1498 ...         MATH_Median( array( 12,48,73,18,4,108,451,2 ) ) === ( 18 + 48 ) / 2
1499 ...     *}
1500 ... 
1501 ...     {*group stats *}
1502 ... 
1503 ...     *}}
1504 ...  */
1505 ... /* ====================================================================== */
1506 ... function MATH_Median( $a )
1507 ... /*----------------------*/
1508 ... {
1509 ...     $fResult = 0.0;                                                 /* Return value of the function */
1510 ... 
1511 ...     $fSum    = array_sum( $a );                                     /* Sum the elements */
1512 ...     $iCount  = count( $a );                                         /* Count the number of elements */
1513 ... 
1514 ...     sort( $a );                                                     /* Sort array */
1515 ... 
1516 ...     if ( $iCount === 0 )                                            /* If no element found */
1517 ...     {
1518 ...         $fResult = null;                                            /* Ready to return a null */
1519 ...     }
1520 ...     elseif ( $iCount % 2 === 1 )                                    /* If odd number of elements */
1521 ...     {
1522 ...         $fResult = $a[(int) $iCount / 2];                           /* Ready to return the middle number */
1523 ...     }   /* if ( $iCount % 2 === 1 ) */
1524 ...     else   /* Else of ... if ( $iCount % 2 === 1 ) */
1525 ...     {
1526 ...         $fResult = ( $a[( (int) $iCount / 2 )    ] +
1527 ...                      $a[( (int) $iCount / 2 ) - 1] ) / 2;
1528 ...     }   /* End of ... Else of ... if ( $iCount % 2 === 1 ) */
1529 ... 
1530 ...     return ( $fResult );                                             /* Return result to caller */
1531 ... }   /* End of function MATH_Median() ==================================== */
1532 ... 
1533 ... /* ====================================================================== */
1534 ... /** {{*MATH_Variance( $a[,$szType] )=
1535 ... 
1536 ...     Returns the variance of the numbers of an array by considering that
1537 ...     the array contains the entire population or is merely a sample ($szType)
1538 ... 
1539 ...     {*params
1540 ...         $a          (array)     Array of numbers
1541 ...         $szType     (string)    Variance type. Either [c]'population'[/c]
1542 ...                                 (default) or [c]'sample'[/c]. Optional.
1543 ...     *}
1544 ... 
1545 ...     {*cdate
1546 ...         30/07/2013 08:57
1547 ...     *}
1548 ... 
1549 ...     {*remark
1550 ...         The average of the squared differences from the Mean.
1551 ...     *}
1552 ... 
1553 ...     {*version
1554 ...         5.4.0010
1555 ...     *}
1556 ... 
1557 ...     {*return
1558 ...         (float)     Variance of $a
1559 ...     *}
1560 ... 
1561 ...     {*exec
1562 ...         $a = array( 1,2,3,4,5 );
1563 ...         echo '<p>',MATH_Variance( $a ),'</p>';
1564 ...     *}
1565 ... 
1566 ...     {*assert MATH_Variance( array( 600,470,170,430,300 ) ) == 21704 *}
1567 ... 
1568 ...     {*doc
1569 ...         [url]http://www.mathsisfun.com/data/standard-deviation.html[/url]
1570 ...     *}
1571 ... 
1572 ...     {*seealso
1573 ...         MATH_Mean(), MATH_Median(), MATH_StandardDeviation()
1574 ...     *}
1575 ... 
1576 ...     {*group stats *}
1577 ... 
1578 ...     *}}
1579 ...  */
1580 ... /* ====================================================================== */
1581 ... function MATH_Variance( $a,$szType = 'population' )
1582 ... /*-----------------------------------------------*/
1583 ... {
1584 ...     $fResult    = 0.0;                                              /* Return value of the function */
1585 ...     $fMean      = 0.0;
1586 ... 
1587 ...     $fSum       = array_sum( $a );                                  /* Sum the elements */
1588 ...     $iCount     = count( $a );                                      /* Count the number of elements */
1589 ... 
1590 ...     if ( $iCount !== 0 )                                            /* If enough elements */
1591 ...     {
1592 ...         $fMean = MATH_Mean( $a );                                   /* Average of array */
1593 ... 
1594 ...         for ( $i = 0;$i < $iCount;$i++ )                            /* Variance = sum of differences compared to mean ^ 2 */
1595 ...         {
1596 ...             $fResult += pow( $a[$i] - $fMean,2 );                   /* Difference with mean ^ 2 */
1597 ...         }   /* for ( $i = 0;$i < $iCount;$i++ ) */
1598 ... 
1599 ...         if ( $szType === 'population' || $iCount === 1 )            /* If variance on population (or only 1 element ... to avoid division by zero) */
1600 ...         {
1601 ...             $fResult = $fResult / $iCount;                          /* Now divide by number of elements */
1602 ...         }   /* if ( $szType === 'population' ... ) */
1603 ...         else    /* Else of ... if ( $szType === 'population' ... ) */
1604 ...         {
1605 ...             $fResult = $fResult / ( $iCount - 1 );                  /* Now divide by number of elements - 1 */
1606 ...         }    /* End of ... Else of ... if ( $szType === 'population' ... ) */
1607 ...     }   /* if ( $iCount !== 0 ) */
1608 ... 
1609 ...     return ( $fResult );                                            /* Return result to caller */
1610 ... }
1611 ... 
1612 ... /* ====================================================================== */
1613 ... /** {{*MATH_StandardDeviation( $a[,$szType] )=
1614 ... 
1615 ...     Returns the standard deviation of the numbers of an array by considering
1616 ...     that the array contains the entire population or is merely a sample
1617 ...     ($szType)
1618 ... 
1619 ...     {*params
1620 ...         $a          (array)     Array of numbers
1621 ...         $szType     (string)    Standard deviation type. Either [c]'population'[/c]
1622 ...                                 (default) or [c]'sample'[/c]. Optional.
1623 ...     *}
1624 ... 
1625 ...     {*cdate
1626 ...         30/07/2013 09:13
1627 ...     *}
1628 ... 
1629 ...     {*version
1630 ...         5.4.0010
1631 ...     *}
1632 ... 
1633 ...     {*return
1634 ...         (float)     Standard deviation of $a
1635 ...     *}
1636 ... 
1637 ...     {*exec
1638 ...         $a = array( 1,2,3,4,5 );
1639 ...         echo '<p>',MATH_StandardDeviation( $a ),'</p>';
1640 ... 
1641 ...         $a = array( 600,470,170,430,300 );
1642 ...         echo '<p>',MATH_StandardDeviation( $a ),'</p>';
1643 ...     *}
1644 ... 
1645 ...     {*doc
1646 ...         [url]http://www.mathsisfun.com/data/standard-deviation.html[/url]
1647 ...     *}
1648 ... 
1649 ...     {*seealso
1650 ...         MATH_Mean(), MATH_Median(), MATH_Variance()
1651 ...     *}
1652 ... 
1653 ...     {*group stats *}
1654 ... 
1655 ...     *}}
1656 ...  */
1657 ... /* ====================================================================== */
1658 ... function MATH_StandardDeviation( $a,$szType = 'population' )
1659 ... /*--------------------------------------------------------*/
1660 ... {
1661 ...     $fResult    = 0.0;                                              /* Return value of the function */
1662 ... 
1663 ...     if ( ! is_null( $fResult = MATH_Variance( $a,$szType ) ) )      /* Get variance of $a */
1664 ...     {
1665 ...         $fResult = sqrt( $fResult );                                /* Get standard deviation */
1666 ...     }   /* if ( ! is_null( $fResult = MATH_Variance( $a,$szType ) ) ) */
1667 ... 
1668 ...     return ( $fResult );                                             /* Return result to caller */
1669 ... }   /* End of function MATH_StandardDeviation() ========================= */
1670 ... 

Manifest Constants

VAESOLI_PATH: Define the path where Vae Soli! is installed

VAESOLI_PLUGINS: Define the path where plugins are located

UltraEdit Syntax files

  1. UltraEdit keywords of LSMath.functions.php
  2. UltraEdit Syntax of LSMath.functions.php

Function List (TOC)

  1. MATH_CircleArea(): Calculates the area of a circle
  2. MATH_CirclePerimeter(): Calculates the perimeter of a circle
  3. MATH_ConeArea(): Calculates the area of a cone
  4. MATH_ConeVolume(): Calculates the volume of a cone
  5. MATH_Credit(): Calculates the monthly amount of a credit whose capital is $C, duration $n months at an annual rate of $t No assertion found for MATH_Credit() (0 - 0)
  6. MATH_CubeArea(): Calculates the area of a cube
  7. MATH_CubeVolume(): Calculates the volume of a cube
  8. MATH_CylinderArea(): Calculates the area of a sylinder
  9. MATH_CylinderVolume(): Calculates the volume of a sylinder
  10. MATH_DiamondArea(): Calculates the area of a diamond
  11. MATH_DiamondPerimeter(): Calculates the perimeter of a diamond
  12. MATH_EllipseArea(): Calculates the area of an ellipse
  13. MATH_EllipseVolume(): Calculates the volume of an ellipse
  14. MATH_GeoDistance(): Calculates the distance between 2 points (oblateness of the earth considered)
  15. MATH_Hypotenuse(): Calculates the hypotenuse of 2 sides
  16. MATH_Mean(): Returns the average of a set of numbers.
  17. MATH_Median(): Returns the median of a set of numbers. If odd number of elements, the median is the middle number. If even, median is the mean of the two middle numbers.
  18. MATH_PyramidArea(): Calculates the area of the pyramid
  19. MATH_PyramidVolume(): Calculates the volume of a rectangular solid
  20. MATH_RectangleArea(): Calculates the area of a rectangle
  21. MATH_RectanglePerimeter(): Calculates the perimeter of a rectangle
  22. MATH_RectangularVolume(): Calculates the volume of a rectangular solid
  23. MATH_SectorArea(): Calculates the area of the $theta sector of a circle with the $r radius
  24. MATH_SectorArea2(): Calculates the area of the $angle sector of a circle with the $r radius
  25. MATH_SphereVolume(): Calculates the volume of a sphere
  26. MATH_SquareArea(): Calculates the area of a square
  27. MATH_SquarePerimeter(): Calculates the perimeter of a square
  28. MATH_StandardDeviation(): Returns the standard deviation of the numbers of an array by considering that the array contains the entire population or is merely a sample ($szType) No assertion found for MATH_StandardDeviation() (0 - 0)
  29. MATH_TrapezeArea(): Calculates the area of a trapezoid
  30. MATH_TriangleArea(): Calculates the area of a triangle
  31. MATH_TrianglePerimeter(): Calculates the perimeter of a triangle
  32. MATH_Variance(): Returns the variance of the numbers of an array by considering that the array contains the entire population or is merely a sample ($szType)

Functions of LSMath.functions.php

MATH_CircleArea(): Calculates the area of a circle

[ back to function list ]

Created: 09/06/2014 12:01

Since version 6.0.0008

Remark

Formula: Pi x r2

Syntax

MATH_CircleArea( $r )

Parameters
NameTypeDescription
$r float a radius of the circle
Return

(float) Area of the circle

Assertions

MATH_Between( MATH_CircleArea( 5 ),78,79 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SphereVolume()

Groups

area

MATH_CirclePerimeter(): Calculates the perimeter of a circle

[ back to function list ]

Created: 10/06/2014 07:59

Since version 6.0.0008

Warning

The result that is given back is an approximation given the irrationality of Pi. Use MATH_Between() for comparisons.

Syntax

MATH_CirclePerimeter( $r )

Parameters
NameTypeDescription
$r float radius of the circle
Return

(float) Perimeter of the circle

Example Executed
echo MATH_CirclePerimeter( 5 );

31.415926535898
Assertions

MATH_Between( MATH_CirclePerimeter( 5 ),31.415,31.416 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_RectanglePerimeter()

Groups

perimeter

MATH_ConeArea(): Calculates the area of a cone

[ back to function list ]

Created: 10/06/2014 06:20

Since version 6.0.0008

Syntax

MATH_ConeArea( $r,$h,$bWithBase )

Parameters
NameTypeDescription
$r float radius of the cone
$h float height of the cone
$bWithBase bool include base area. Optional: true by default.
Return

(float) Area of the cone

Example Executed
echo MATH_ConeArea( 5,10 );

254.16018461576
Assertions

MATH_Between( MATH_ConeArea( 5,10 ),254.16,254.17 ) successful

MATH_Between( MATH_ConeArea( 5,10,false ),175.62,175.63 ) successful

Unit Testing

2 assertions: 2 successful; 0 failed

See Also

MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(), MATH_TriangleArea(), MATH_TrapezeArea(), MATH_ConeVolume()

Groups

area

MATH_ConeVolume(): Calculates the volume of a cone

[ back to function list ]

Created: 09/06/2014 11:38

Since version 6.0.0008

Remark

The volume of a cone is exactly a third (1/3) of the volume of the cylinder having the same parameters

Syntax

MATH_ConeVolume( $r,$h )

Parameters
NameTypeDescription
$r float radius of the base of the cone
$h float height of the cone
Return

(float) Volume of the cone

Example Executed
echo MATH_ConeVolume( 5,10 );

261.79938779915
Assertions

MATH_Between( MATH_ConeVolume( 5,10 ),261.799,261.800 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_RectangularVolume(), MATH_CubeVolume(), MATH_SphereVolume(), MATH_CylinderVolume(), MATH_ConeArea()

Groups

volume

MATH_Credit(): Calculates the monthly amount of a credit whose capital is $C, duration $n months at an annual rate of $t

[ back to function list ]

Created: 08/01/2013 08:22

Since version 5.0.0011

Warning

This should be found in Finance functions

Docs

Syntax

MATH_Credit( $C,$n,$t )

Parameters
NameTypeDescription
$C int Amount to borrow
$n int Number of months
$t float Annual rate (all fees included) (APRC - Annual Percentage Rate of Charge)
Return

(float) Monthly amount to be paid

Example Executed
$C = 5000;
$n = 48;
$t = 5.09;

echo '<p>',number_format( MATH_Credit( $C,$n,$t ),2,',','.' ),' EUR</p>';

115,35 EUR

Unit Testing

WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}) or with GuideAssert() function calls in exec constructs ({*exec LSUnitTesting::assert(...); *}).

MATH_CubeArea(): Calculates the area of a cube

[ back to function list ]

Created: 10/06/2014 06:14

Since version 6.0.0008

Syntax

MATH_CubeArea( $b )

Parameters
NameTypeDescription
$b float base of the cube
Return

(float) Area of the cube

Assertions

MATH_CubeArea( 5 ) === (float) 150 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(), MATH_TriangleArea(), MATH_TrapezeArea()

Groups

area

MATH_CubeVolume(): Calculates the volume of a cube

[ back to function list ]

Created: 09/06/2014 10:58

Since version 6.0.0008

Syntax

MATH_CubeVolume( $a )

Parameters
NameTypeDescription
$a float side of the cube
Return

(float) Volume of the cube

Assertions

MATH_CubeVolume( 10 ) !== 1000 successful

MATH_CubeVolume( 10 ) === (float) 1000 successful

(int) MATH_CubeVolume( 10 ) === 1000 successful

Unit Testing

3 assertions: 3 successful; 0 failed

See Also

MATH_RectangularVolume(), MATH_SphereVolume()

Groups

volume

MATH_CylinderArea(): Calculates the area of a sylinder

[ back to function list ]

Created: 10/06/2014 07:56

Since version 6.0.0008

Warning

The result that is given back is an approximation given the irrationality of Pi. Use MATH_Between() for comparisons.

Syntax

MATH_CylinderArea( $r,$h )

Parameters
NameTypeDescription
$r float radius of the base of the cylinder
$h float height of the cylinder
Return

(float) Area of the cylinder

Example Executed
echo MATH_CylinderArea( 5,10 );

314.15926535898
Assertions

MATH_Between( MATH_CylinderArea( 5,10 ),314,315 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_CylinderVolume(), MATH_ConeArea(), MATH_TrapezeArea(), MATH_TriangleArea(), MATH_RectangleArea()

Groups

area

MATH_CylinderVolume(): Calculates the volume of a sylinder

[ back to function list ]

Created: 09/06/2014 12:20

Since version 6.0.0008

Warning

The result that is given back is an approximation given the irrationality of Pi. Use MATH_Between() for comparisons.

Syntax

MATH_CylinderVolume( $r,$h )

Parameters
NameTypeDescription
$r float radius of the base of the cylinder
$h float height of the cylinder
Return

(float) Volume of the cylinder

Example Executed
echo MATH_CylinderVolume( 5,10 );

785.39816339745
Assertions

MATH_Between( MATH_CylinderVolume( 5,10 ),785.398,786.399 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_ConeVolume()

Groups

volume

MATH_DiamondArea(): Calculates the area of a diamond

[ back to function list ]

Created: 09/06/2014 16:23

Since version 6.0.0008

Syntax

MATH_DiamondArea( $d1,$d2 )

Parameters
NameTypeDescription
$d1 float diagonal 1 of the diamond
$d2 float diagonal 2 of the diamond
Return

(float) Area of the diamond (lozenge)

Assertions

MATH_DiamondArea( 10,5 ) === (float) 25 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_ParallelogramArea()

Groups

area

MATH_DiamondPerimeter(): Calculates the perimeter of a diamond

[ back to function list ]

Created: 09/06/2014 11:02

Since version 6.0.0008

Author

Warning

Use comparisons with great care as the result is given back as a float

Syntax

MATH_DiamondPerimeter( $d1,$d2 )

Parameters
NameTypeDescription
$d1 float diagonal 1 of the diamond
$d2 float diagonal 2 of the diamond
Return

(float) Perimeter of the diamond (lozenge)

Assertions

MATH_DiamondPerimeter( 6,8 ) === (float) 20 successful

Unit Testing

1 assertions: 1 successful; 0 failed

Groups

perimeter

MATH_EllipseArea(): Calculates the area of an ellipse

[ back to function list ]

Created: 09/06/2014 16:57

Since version 6.0.0008

Syntax

MATH_EllipseArea( $r1,$r2 )

Parameters
NameTypeDescription
$r1 float semi-minor axis
$r2 float semi-major axis
Return

(float) Area of the sector of the ellipse

Assertions

MATH_Between( MATH_EllipseArea( 10,5 ),157.07,157.08 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_RectangleArea(), MATH_TrapezeArea(), MATH_DiamondArea()

Groups

area

MATH_EllipseVolume(): Calculates the volume of an ellipse

[ back to function list ]

Created: 09/06/2014 17:01

Since version 6.0.0008

Syntax

MATH_EllipseVolume( $r1,$r2,$r3 )

Parameters
NameTypeDescription
$r1 float semi-axis A
$r2 float semi-axis B
$r3 float semi-axis C
Return

(float) Volume of the ellipse

Assertions

MATH_Between( MATH_EllipseVolume( 10,5,7 ),1466.07,1466.08 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SphereVolume()

Groups

volume

MATH_GeoDistance(): Calculates the distance between 2 points (oblateness of the earth considered)

[ back to function list ]

Created: 18/07/2012 21:48:54

Since version 5.0.0005

Credits

Caution

The formula is a simplification of the problem and it won't work accurately if the 2 points are too close to each other or too close to the poles

Docs

Syntax

MATH_GeoDistance( $x1,$y1,$x2,$y2 )

Parameters
NameTypeDescription
$x1 float WGS84 geo-coordinate in decimal degree (x-coord) of point 1
$y1 float WGS84 geo-coordinate in decimal degree (y-coord) of point 1
$x2 float WGS84 geo-coordinate in decimal degree (x-coord) of point 2
$y2 float WGS84 geo-coordinate in decimal degree (y-coord) of point 2
Parameters Warning

MATH_GeoDistance() uses 4 parameters whereas the suggested limit is 3.

Return

(float) Distance in meters between 2 geo points (latitude and longitude)

Example Executed
// Home : Rue Bois des Mazuis, 47 - 5070 Vitrival
$x1         = 4.660489;     // Longitude
$y1         = 50.385496;    // Latitude

// Work: Avenue du Boulevard 21, 1210 Saint-Josse-ten-Noode, Belgium (BE)
$x2         = 4.356916;     // Longitude
$y2         = 50.855891;    // Latitude

echo '<p>',number_format( ( $fDistance = MATH_GeoDistance($x1,$y1,$x2,$y2 ) ) / 1000,2,',','.' ),'km</p>';

echo LSUnitTesting::assert( $fDistance > 62100 && $fDistance < 62200                ,
                            'ASSERTION SUCCESSFUL: distance calculated correctly'   ,
                            'ASSERTION FAILURE: wrong distance'                     ,
                            'GuideAssert' );

62,19km

GuideAssert() ... ASSERTION SUCCESSFUL: distance calculated correctly

Unit Testing

1 assertions: 1 successful; 0 failed

MATH_Hypotenuse(): Calculates the hypotenuse of 2 sides

[ back to function list ]

Created: 10/06/2014 08:12

Since version 6.0.0008

Author

Syntax

MATH_Hypotenuse( $a,$b )

Parameters
NameTypeDescription
$a float side 1 of the hypotenuse
$b float side 2 of the hypotenuse
Return

(float) Hypotenuse of 2 sides

Assertions

MATH_Hypotenuse( 3,4 ) === (float) 5 successful

Unit Testing

1 assertions: 1 successful; 0 failed

Groups

geometry

MATH_Mean(): Returns the average of a set of numbers.

[ back to function list ]

Created: 30/07/2013 07:40

Since version 5.4.0010

Syntax

MATH_Mean( $a )

Parameters
NameTypeDescription
$a array Array of numbers
Return

(float) Average of $a or null if average cannot be calculated.

Example Executed
$a = array( 1,2,3,4,5 );
echo '<p>',MATH_Mean($a),'</p>';

$a = array();
if ( is_null( MATH_Mean( $a ) ) )
{
    echo '<p>Undefined result</p>';
}

3

Undefined result

Assertions

MATH_Mean( array( 1,2,3,4,5 ) ) === 3 successful

is_null( MATH_Mean() ) successful

is_null( MATH_Mean( array() ) ) successful

is_null( MATH_Mean( true ) ) successful

Unit Testing

4 assertions: 4 successful; 0 failed

See Also

MATH_Median(), MATH_Variance(), MATH_StandardDeviation()

Groups

stats

MATH_Median(): Returns the median of a set of numbers. If odd number of elements, the median is the middle number. If even, median is the mean of the two middle numbers.

[ back to function list ]

Created: 30/07/2013 08:37

Since version 5.4.0010

Syntax

MATH_Median( $a )

Parameters
NameTypeDescription
$a array Array of numbers
Return

(float) Median of $a or null if median cannot be calculated.

Example Executed
$a = array( 1,2,3,4,5 );
echo '<p>',MATH_Median($a),'</p>';

$a = array( 4,3,5,1,2 );
echo '<p>',MATH_Median($a),'</p>';

$a = array( 1 );
echo '<p>',MATH_Median($a),'</p>';

$a = array( 12,48,73,18,4,108,451 );
echo '<p>',MATH_Median($a),'</p>';

$a = array( 12,48,73,18,4,108,451,2 );
echo '<p>',MATH_Median($a),'</p>';

3

3

1

48

33

Assertions

MATH_Median( array( 4,3,5,1,2 ) ) === 3 successful

MATH_Median( array( 12,48,73,18,4,108,451,2 ) ) === ( 18 + 48 ) / 2 successful

Unit Testing

2 assertions: 2 successful; 0 failed

See Also

MATH_Mean(), MATH_Variance(), MATH_StandardDeviation()

Groups

stats

MATH_PyramidArea(): Calculates the area of the pyramid

[ back to function list ]

Created: 10/06/2014 06:09

Since version 6.0.0008

Syntax

MATH_PyramidArea( $b,$h )

Parameters
NameTypeDescription
$b float base of the pyramid
$h float height of the pyramid
Return

(float) Area of the pyramid (4 triangles + base)

Example Executed
echo MATH_PyramidArea( 5,10 );

128.07764064044
Assertions

MATH_Between( MATH_PyramidArea( 5,10 ),128.077,128.078 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SectorArea(), MATH_SectorArea2(), MATH_ReactangleArea(), MATH_TriangleArea(), MATH_TrapezeArea()

Groups

area

MATH_PyramidVolume(): Calculates the volume of a rectangular solid

[ back to function list ]

Created: 09/06/2014 11:38

Since version 6.0.0008

Remark

The volume of a pyramid is exactly a third (1/3) of the volume of the rectangular solid based on the same parameters

Syntax

MATH_PyramidVolume( $l,$w,$h )

Parameters
NameTypeDescription
$l float length of the base of the pyramid
$w float width of the base of the pyramid
$h float height of the pyramid
Return

(float) Volume of the pyramid

Example Executed
echo MATH_PyramidVolume( 5,5,10 );

83.333333333333
Assertions

MATH_Between( MATH_PyramidVolume( 5,5,10 ),83.33,83.34 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_RectangularVolume(), MATH_CubeVolume()

Groups

volume

MATH_RectangleArea(): Calculates the area of a rectangle

[ back to function list ]

Created: 09/06/2014 11:58

Since version 6.0.0008

Syntax

MATH_RectangleArea( $l,$w )

Parameters
NameTypeDescription
$l float length of the rectangle
$w float width of the rectangle
Return

(float) Area of the rectangle

Assertions

MATH_RectangleArea( 5,10 ) === (float) 50 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SquareArea(), MATH_RectangularVolume()

Groups

area

MATH_RectanglePerimeter(): Calculates the perimeter of a rectangle

[ back to function list ]

Created: 10/06/2014 08:11

Since version 6.0.0008

Syntax

MATH_RectanglePerimeter( $l,$w )

Parameters
NameTypeDescription
$l float length of the rectangle
$w float width of the rectangle
Return

(float) Perimeter of the rectangle

Assertions

MATH_RectanglePerimeter( 5,10 ) === (float) 30 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_CirclePerimeter(), MATH_SquarePerimeter()

Groups

perimeter

MATH_RectangularVolume(): Calculates the volume of a rectangular solid

[ back to function list ]

Created: 09/06/2014 11:27

Since version 6.0.0008

Syntax

MATH_RectangularVolume( $l,$w,$h )

Parameters
NameTypeDescription
$l float length of the rectangular solid
$w float width of the rectangular solid
$h float height of the rectangular solid
Return

(float) Volume of the rectangular solid

Assertions

MATH_RectangularVolume( 5,5,5 ) === MATH_CubeVolume( 5 ) successful

MATH_RectangularVolume( 5,6,7 ) === (float) 210 successful

Unit Testing

2 assertions: 2 successful; 0 failed

See Also

MATH_CubeVolume(), MATH_SphereVolume()

Groups

volume

MATH_SectorArea(): Calculates the area of the $theta sector of a circle with the $r radius

[ back to function list ]

Created: 09/06/2014 16:31

Since version 6.0.0008

Syntax

MATH_SectorArea( $r,$theta )

Parameters
NameTypeDescription
$r float radius of the circle
$theta float angle in radians
Return

(float) Area of the sector of a circle of radius $r, angle $theta

Assertions

MATH_SectorArea2( 5,90 ) === MATH_SectorArea( 5,deg2rad( 90 ) ) successful

MATH_SectorArea2( 5,90 ) === ( MATH_CircleArea( 5 ) / 4 ) successful

Unit Testing

2 assertions: 2 successful; 0 failed

See Also

MATH_SectorArea2()

Groups

area

MATH_SectorArea2(): Calculates the area of the $angle sector of a circle with the $r radius

[ back to function list ]

Created: 09/06/2014 18:57

Since version 6.0.0008

Syntax

MATH_SectorArea2( $r,$angle )

Parameters
NameTypeDescription
$r float radius of the circle
$angle float angle in degrees
Return

(float) Area of the sector of a circle of radius $r, angle $angle

Assertions

MATH_Between( MATH_SectorArea2( 5,90 ),19.634,19.635 ) successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_SectorArea()

Groups

area

MATH_SphereVolume(): Calculates the volume of a sphere

[ back to function list ]

Created: 09/06/2014 11:02

Since version 6.0.0008

Warning

The result that is given back is an approximation given the irrationality of Pi

Syntax

MATH_SphereVolume( $r )

Parameters
NameTypeDescription
$r float radius of the sphere
Return

(float) Volume of the sphere

Example Executed
echo MATH_SphereVolume( 6 );

904.77868423386
Assertions

MATH_Between( MATH_SphereVolume( 6 ),904.77,904.78,0.001 ) successful

MATH_Between( MATH_SphereVolume( 6 ),904.778,904.779 ) successful

Unit Testing

2 assertions: 2 successful; 0 failed

Groups

volume

MATH_SquareArea(): Calculates the area of a square

[ back to function list ]

Created: 09/06/2014 12:00

Since version 6.0.0008

Syntax

MATH_SquareArea( $a )

Parameters
NameTypeDescription
$a float side of the square
Return

(float) Area of the square

Assertions

MATH_SquareArea( 5 ) === (float) 25 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_ReactangleArea(), MATH_CubeVolume(), MATH_CircleArea()

Groups

area

MATH_SquarePerimeter(): Calculates the perimeter of a square

[ back to function list ]

Created: 10/06/2014 08:11

Since version 6.0.0008

Syntax

MATH_SquarePerimeter( $a )

Parameters
NameTypeDescription
$a float side of the square
Return

(float) Perimeter of the rectangle

Assertions

MATH_SquarePerimeter( 5 ) === (float) 20 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_CirclePerimeter(), MATH_RectanglePerimeter()

Groups

perimeter

MATH_StandardDeviation(): Returns the standard deviation of the numbers of an array by considering that the array contains the entire population or is merely a sample ($szType)

[ back to function list ]

Created: 30/07/2013 09:13

Since version 5.4.0010

Docs

Syntax

MATH_StandardDeviation( $a,$szType )

Parameters
NameTypeDescription
$a array Array of numbers
$szType string Standard deviation type. Either 'population' (default) or 'sample'. Optional.
Return

(float) Standard deviation of $a

Example Executed
$a = array( 1,2,3,4,5 );
echo '<p>',MATH_StandardDeviation( $a ),'</p>';

$a = array( 600,470,170,430,300 );
echo '<p>',MATH_StandardDeviation( $a ),'</p>';

1.4142135623731

147.32277488562

Unit Testing

WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}) or with GuideAssert() function calls in exec constructs ({*exec LSUnitTesting::assert(...); *}).

See Also

MATH_Mean(), MATH_Median(), MATH_Variance()

Groups

stats

MATH_TrapezeArea(): Calculates the area of a trapezoid

[ back to function list ]

Created: 09/06/2014 16:18

Since version 6.0.0008

Syntax

MATH_TrapezeArea( $b1,$b2,$h )

Parameters
NameTypeDescription
$b1 float base1 of the trapezoid
$b2 float base2 of the trapezoid
$h float height of the trapezoid
Return

(float) Area of the trapezoid

Assertions

MATH_TrapezeArea( 10,10,10 ) === (float) 100 successful

MATH_TrapezeArea( 5,10,10 ) === (float) 75 successful

Unit Testing

2 assertions: 2 successful; 0 failed

See Also

MATH_RectangleArea()

Groups

area

MATH_TriangleArea(): Calculates the area of a triangle

[ back to function list ]

Created: 09/06/2014 16:23

Since version 6.0.0008

Syntax

MATH_TriangleArea( $b,$h )

Parameters
NameTypeDescription
$b float base of the triangle
$h float height of the triangle
Return

(float) Area of the triangle

Assertions

MATH_TriangleArea( 10,7 ) === (float) 35 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_RectangleArea(), MATH_TrapezeArea()

Groups

area

MATH_TrianglePerimeter(): Calculates the perimeter of a triangle

[ back to function list ]

Created: 10/06/2014 08:11

Since version 6.0.0008

Syntax

MATH_TrianglePerimeter( $a,$b,$c )

Parameters
NameTypeDescription
$a float side a of the triangle
$b float side b of the triangle
$c float side c of the triangle
Return

(float) Perimeter of the triangle

Assertions

MATH_TrianglePerimeter( 5,4,4 ) === (float) 13 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_CirclePerimeter(), MATH_RectanglePerimeter()

Groups

perimeter

MATH_Variance(): Returns the variance of the numbers of an array by considering that the array contains the entire population or is merely a sample ($szType)

[ back to function list ]

Created: 30/07/2013 08:57

Since version 5.4.0010

Remark

The average of the squared differences from the Mean.

Docs

Syntax

MATH_Variance( $a,$szType )

Parameters
NameTypeDescription
$a array Array of numbers
$szType string Variance type. Either 'population' (default) or 'sample'. Optional.
Return

(float) Variance of $a

Example Executed
$a = array( 1,2,3,4,5 );
echo '<p>',MATH_Variance( $a ),'</p>';

2

Assertions

MATH_Variance( array( 600,470,170,430,300 ) ) == 21704 successful

Unit Testing

1 assertions: 1 successful; 0 failed

See Also

MATH_Mean(), MATH_Median(), MATH_StandardDeviation()

Groups

stats

Groups of LSMath.functions.php

area

MATH_CircleArea(), MATH_ConeArea(), MATH_CubeArea(), MATH_CylinderArea(), MATH_DiamondArea(), MATH_EllipseArea(), MATH_PyramidArea(), MATH_RectangleArea(), MATH_SectorArea(), MATH_SectorArea2(), MATH_SquareArea(), MATH_TrapezeArea(), MATH_TriangleArea()

geometry

MATH_Hypotenuse()

perimeter

MATH_CirclePerimeter(), MATH_DiamondPerimeter(), MATH_RectanglePerimeter(), MATH_SquarePerimeter(), MATH_TrianglePerimeter()

stats

MATH_Mean(), MATH_Median(), MATH_StandardDeviation(), MATH_Variance()

volume

MATH_ConeVolume(), MATH_CubeVolume(), MATH_CylinderVolume(), MATH_EllipseVolume(), MATH_PyramidVolume(), MATH_RectangularVolume(), MATH_SphereVolume()

Précédent Suivant