/math-lib

A mathematic library (later may be AI lib)

Primary LanguageJava

Java Math Library

Overview

This Java Math Library provides a set of classes for fundamental mathematical operations, particularly focusing on linear algebra and 2D geometry. The library includes classes for coordinates, matrices, vectors, and points, facilitating mathematical computations in a variety of applications.

File Hierarchy

  • Coordinate: Class for representing coordinates in mathematical spaces.

  • LinearAlgebra: Abstract class serving as the foundation for linear algebra operations.

  • Matrix: Class for matrix operations.

  • MatrixGeo: Interface defining geometric operations for matrices.

  • Point: Class representing points in mathematical spaces.

  • TwoDLib: Class for 2D geometry operations.

  • Vector: Class for vector operations.

  • VectorGeo: Interface defining geometric operations for vectors.

Usage

To use this library in your Java project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/JavaMathLibrary.git
  2. Import the necessary classes into your project:

    import com.yourcompany.mathlibrary.Coordinate;
    import com.yourcompany.mathlibrary.LinearAlgebra;
    import com.yourcompany.mathlibrary.Matrix;
    import com.yourcompany.mathlibrary.MatrixGeo;
    import com.yourcompany.mathlibrary.Point;
    import com.yourcompany.mathlibrary.TwoDLib;
    import com.yourcompany.mathlibrary.Vector;
    import com.yourcompany.mathlibrary.VectorGeo;
  3. Utilize the classes and methods based on your mathematical requirements.

Examples

Matrix Operations

Matrix matrixA = new Matrix(3, 3);
Matrix matrixB = new Matrix(3, 3);

// Populate matrices with values
// ...

// Matrix addition
Matrix result = matrixA.add(matrixB);

// Matrix multiplication
Matrix product = matrixA.multiply(matrixB);

2D Geometry

Point pointA = new Point(2, 3);
Point pointB = new Point(5, 7);

// Distance between two points
double distance = TwoDLib.distanceBetweenPoints(pointA, pointB);

Contributing

If you would like to contribute to the development of this library, please follow our Contribution Guidelines.

License

This project is licensed under the MIT License.

Feel free to customize the readme further based on your specific project details and requirements. Add sections for installation instructions, additional examples, or any other relevant information.