Skip to content

Vector Calculator: A Python-based tool for performing essential vector operations, including addition, dot product, and cross product. Users can input vector components and receive immediate results, making it ideal for learning and practicing vector mathematics.

Notifications You must be signed in to change notification settings

Anurag1101/Vector_Calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 

Repository files navigation

Vector_Calc

Description:

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.

Features:

  • 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.

Code Overview:

The main components of the code include:

Vector Class:

  • 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.

Input Function:

  • Prompts users to enter the components of a vector.

  • Returns a Vector object based on user input.

Main Program Logic:

Accepts input for three vectors from the user.

Displays the results of the vector operations (addition, dot product, and cross product).

How to Use:

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

Follow the prompts to input the vector components and view the results of the operations.

Example Input

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

Output:

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)

License:

This project is licensed under the MIT License - see the LICENSE file for details.

About

Vector Calculator: A Python-based tool for performing essential vector operations, including addition, dot product, and cross product. Users can input vector components and receive immediate results, making it ideal for learning and practicing vector mathematics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages