PHP Classes

How to Use a PHP Geometry Library to Perform Calculations with Shapes, Volumes, Equations, and Matrices Using the Package TMaths Handler: Perform mathematics and geometric calculations

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-01-10 (10 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 8 This week: 2All time: 11,514 This week: 27Up
Version License PHP version Categories
tmathshandler 25.0.0Custom (specified...8.2Math, PHP 8
Description 

Author

This package can perform mathematics and geometric calculations.

It provides a class with many functions to perform several types of calculations.

Currently, it can calculate:

- Absolute value of each number in an array

- Area of a circle, parallelogram, decagon, dodecagon, heptagon, hexagon, icosahedron, nonagon, pentadecagon, pentagon, polygon given the number of sides and the length of each side, hombus given its diagonals, square, trapezoid, triangle given its base and height, triangle using Heron's formula

- Binomial coefficient (n choose k)

- Solution a system of nonlinear equations using Broyden's method

- Circumference of a circle

- Circle circumscribed around a square

- The radius of the circumscribed circle around a triangle

- Number of combinations of n items taken r at a time

- Combinations of a given size from an array of elements

- Addition of two complex numbers

- The conjugate of a complex number

- The derivative of a complex function

- Divide two complex numbers

- exponential of a complex number

- Integral of a complex function over an interval

- Logarithm of a complex number

- Magnitude of a complex number

- Multiply two complex numbers

- Hyperbolic cosine of an angle

- Cotangent of an angle

- Cosecant of an angle

- Deflate a polynomial by a given root

- Derivative of a function at a given point

- Determinants of a matrix using cofactor expansion

- Length of the diagonal of a cube

- Diagonal of a rectangle

- Length of a diagonal of a regular dodecagon

- Length of a diagonal of a regular nonagon

- Length of a diagonal of a regular octagon

- Diagonal of a square

- Distance between two points in a plane

- Evaluation of a polynomial at a given point

- Evaluation of the derivative of a polynomial at a given point

- Exponential function

- Factorial of a number

- Factorial of a number using iteration

- Roots of a polynomial

- Solution of a system of linear equations using the Gauss-Seidel iterative method

- Greatest common divisor (GCD) of two numbers

- Generation of submatrices of a given size from a matrix

- Geometric mean of an array of numbers

- Harmonic mean of an array of numbers

- Hypotenuse of a right triangle using the Pythagorean theorem

- Radius of a circle inscribed in a square

- Radius of the circle inscribed in a triangle

- Integral of a function over an interval using the trapezoidal rule

- Integral of a function over an interval using Simpson's rule

- Integral of a function over an interval using the trapezoidal rule

- If a number is a prime number

- Soluition of a system of linear equations using the Jacobi iterative method
length of a side of a triangle using the law of cosines
logarithmic function

- Least common multiple (LCM) of two numbers

- Adjugate of a matrix

- Cofactor of a matrix

- Determinant of a matrix

- Eigenvalues of a matrix

- Inverse of a matrix

- Minor of an element in a matrix

- Multiply two matrices

- Rank of a matrix

- Trace of a matrix

- Transpose a matrix

- Mean of an array of numbers

- Median of an array of numbers

- Natural logarithm of a number

- Solution of a system of nonlinear equations using the Newton-Raphson method

- Root of a function using Newton's method

- Perimeter of a polygon given an array of side lengths

- Perimeter of a regular polygon given the number of sides and the length of each side

- Perimeter of a regular polygon given its radius

- Perimeter of a triangle given its three sides
number of permutations of n items taken r at a time
exponential of a number

- Perform QR decomposition of a matrix
quadratic mean (root mean square) of an array of numbers

- Root mean square (RMS) of an array of numbers
secant of an angle

- Second derivative of a function at a given point

- Side length of a regular hexagon given its area
side length of a regular polygon given its radius

- Hyperbolic sine of an angle

- Solution of a first-order differential equation using Euler's method

- Solution of a system of linear equations using Gaussian elimination

- Solution of a quadratic equation ax^2 + bx + c = 0

- Solution of a second-order differential equation using Euler's method
standard deviation of an array of numbers

- Surface area of a cone, cylinder, ellipsoid, a decagon, icosahedron, icosahedron given its circumscribed radius, area of a regular pentadecagon, sphere, radius, tetrahedron

- Taylor series expansion of a function at a given point
hyperbolic tangent of an angle
- Third derivative of a function at a given point

- Variance of an array of numbers

- Volume of a cone, cylinder, pyramid, rectangular prism (cuboid), dodecahedron, given its circumscribed radius, heptagon, icosahedron, icosahedron given its inradius, octahedron, pentadecagon, sphere given its surface area, tetrahedral pyramid

Picture of ASCOOS CMS
  Performance   Level  
Name: ASCOOS CMS <contact>
Classes: 25 packages by
Country: Greece Greece
Age: ???
All time rank: 379423 in Greece Greece
Week rank: 8 Up1 in Greece Greece Up
Innovation award
Innovation award
Nominee: 14x

Winner: 1x

Instructions

This package requires Ascoos Framework >= 25.0.0

Example

<?php
/**
 * __ _ ___ ___ ___ ___ ___ ____ _ __ ___ ___
 * / _` |/ / / __/ _ \ / _ \ / / / __/| '_ ` _ \ / /
 * | (_| |\ \| (_| (_) | (_) |\ \ | (__ | | | | | |\ \
 * \__,_|/__/ \___\___/ \___/ /__/ \___\|_| |_| |_|/__/
 *
 *
 ************************************************************************************
 * @ASCOOS-NAME : ASCOOS CMS 25' *
 * @ASCOOS-VERSION : 25.0.0 *
 * @ASCOOS-CATEGORY : Framework (Frontend and Administrator Side) *
 * @ASCOOS-CREATOR : Drogidis Christos *
 * @ASCOOS-SITE : www.ascoos.com *
 * @ASCOOS-LICENSE : [Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html *
 * @ASCOOS-COPYRIGHT : Copyright (c) 2007 - 2025, AlexSoft Software. *
 ************************************************************************************
 *
 * @package : ASCOOS FRAMEWORK - TMathsHandler Examples
 * @subpackage : Find the roots of a polynomial.
 * @source : examples/findPolynomialRoots.php
 * @fileNo :
 * @version : 25.0.0
 * @build : 10845
 * @created : 2025-01-09 07:00:00 UTC+2
 * @updated :
 * @author : Drogidis Christos
 * @authorSite : www.alexsoft.gr
 * @license : AGL-F
 *
 * @since PHP 8.2
 */

// REQUIRE ASCOOS FRAMEWORK
require_once '[ASCOOS FRAMEWORK PATH]/autoload.php';
require_once
'../class/coreMaths.php';


use
ASCOOS\FRAMEWORK\Kernel\Maths\TMathsHandler;


$mathsHandler = new TMathsHandler();
$coefficients = [1, -6, 11, -6]; // Polynomial: x^3 - 6x^2 + 11x - 6
$roots = $mathsHandler->findPolynomialRoots($coefficients);

echo
"Roots of the polynomial: ";
print_r($roots);
?>


  Files folder image Files (6)  
File Role Description
Files folder imageclass (1 file)
Files folder imageexamples (4 files)
Accessible without login Plain text file LICENSE_AGL-F.md Lic. License text

  Files folder image Files (6)  /  class  
File Role Description
  Plain text file coreMaths.php Class Class source

  Files folder image Files (6)  /  examples  
File Role Description
  Accessible without login Plain text file complexExponential.php Example Calculate the exponential of a complex number.
  Accessible without login Plain text file findPolynomialRoots.php Example Find the roots of a polynomial.
  Accessible without login Plain text file matrixInverse.php Example Calculate the inverse of a matrix.
  Accessible without login Plain text file qrDecomposition.php Example Perform QR decomposition of a matrix.

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadtmathshandler-2025-01-10.zip 29KB
Downloadtmathshandler-2025-01-10.tar.gz 27KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Ascoos Framework Download .zip .tar.gz part of Ascoos Framework Required
 Version Control Unique User Downloads Download Rankings  
 100%
Total:8
This week:2
All time:11,514
This week:27Up