This is a simple vector
calculator implemented in Python. It allows users to perform basic vector operations, including vector addition
, dot-product
, and cross-product
. The program prompts users to input the components of vectors and outputs the results of the operations.
-
Vector Addition: Add two vectors and get the resultant vector.
-
Dot Product: Calculate the dot product of two vectors.
-
Cross Product: Compute the cross product of two vectors.
The main components of the code include:
-
Initializes a vector with x, y, and z components.
-
Implements vector addition, dot product, and cross product operations.
-
Provides a string representation of the vector in i,j,k form.
-
Prompts users to enter the components of a vector.
-
Returns a Vector object based on user input.
Accepts input for three vectors from the user.
Displays the results of the vector operations (addition, dot product, and cross product).
Clone the repository to your local machine:
git clone https://github.com/yourusername/Vector_Calc.git
Navigate to the project directory:
cd Vector_Calc
Run the program:
python vector_calculator.py
Input first vector:
Enter x component: 1
Enter y component: 2
Enter z component: 3
Input second vector:
Enter x component: 4
Enter y component: 5
Enter z component: 6
Input third vector:
Enter x component: 7
Enter y component: 8
Enter z component: 9
Addition: Vector(5i + 7j + 9k)
Dot Product: 32
Cross Product: Vector(-3i + 6j + -3k)
Addition: Vector(8i + 10j + 12k)
Dot Product: 50
Cross Product: Vector(-6i + 12j + -6k)
This project is licensed under the MIT
License - see the LICENSE file for details.