Untitled
Chapter 1: Vectors in 3D Space and Vector Space
1. Vectors in 3D Space
1.1 Rectangular Cartesian Coordinate Systems
In Rectangular Cartesian coordinate systems, vectors that span the frame axes (X, Y, Z) are defined with respect to three basis vectors: . These vectors represent the unit vectors along the X, Y, and Z axes, respectively. There are two conventions for these coordinate systems:
Left-handed system: Used in DirectX.
Right-handed system: Used in OpenGL and is the standard convention in mathematics and physics.
The right-handed system defines an orthonormal basis where the vectors satisfy:
1.2 Definition and Representation of Vectors
A vector is defined as a mathematical entity that possesses both a direction and a magnitude. For example, a vector can be represented in 3D space as:
,
where:
is the 1st component.
is the 2nd component.
is the 3rd component.
Three fundamental vectors that span the world space are defined as:
Any vector in the world space can be expressed as a linear combination of these basis vectors:
For example, for , it can be expressed as:
1.3 Python Implementation
To define a vector in Python, you can use the NumPy, SciPy, or SymPy libraries. Here are examples:
NumPy:
import numpy as np
vector = np.array([data], dtype=float)
SciPy:
import scipy
vector = scipy.array([data], dtype=float)
SymPy:
from sympy import Matrix
vector = Matrix(data)
2. Vector Norm
2.1 Definition
Given a vector , its norm (or length or magnitude) is defined as:
where:
For all basis vectors,
2.2 Examples
Example 2.1: Calculate the norm of :
Example 2.2: Calculate the norm of :
2.3 How to Compute Vector Length in Python
Python uses the following methods to compute lengths:
NumPy:
numpy.linalg.norm()SciPy:
scipy.linalg.norm()SymPy:
magnitude()fromsympy.physics.vector.
3. Normalized Vectors and Unit Vectors
3.1 Normalization
A normalized vector is one that has a magnitude of 1. It is obtained by dividing the vector by its magnitude:
A unit vector can also be referred to as a normalized vector. The normalization condition is:
3.2 Examples
Example 3.1: Normalize :
First, find the norm:
Then normalize:
Example 3.2: Normalize :
First, find the norm:
Then normalize:
3.3 Normalizing a Vector in Python
To normalize a vector in Python, use:
normalize()fromsympy.physics.vector.
4. Vector Direction
The direction of a vector is represented by its normalized vector:
4.1 Examples
Example 4.1: Determine the direction of a car moving with a velocity :
First, find the norm:
Hence, the direction is:
5. Parallel and Collinear Vectors
Vectors and are parallel if:
for some scalar . The relationship can be defined as:
5.1 Examples
Example 5.1: Prove that vectors and are collinear:
6. Building a Vector From Two Given Points (Vertices)
Given two points (vertices) and , the vector is defined as:
Here, is the vector origin and is the vector head (terminal point).
The opposite of vector is denoted as . It follows that:
where .
6.1 Distance Between Two Points
The distance between points and can be computed as:
6.2 Example
Example 6.1: Given two vertices and :
Compute the vector :
The opposite vector is:
.Distance:
7. Vectors Algebra
Given two vectors and :
7.1 Vector Addition
Vectors are added component-wise:
Example 7.1: Adding Two Vectors
Let and :
7.2 Scalar Multiplication
A vector can be multiplied by a scalar:
Example 7.2:
Let then:
7.3 Pythonic Examples
For addition in Python, you can use:
NumPy:
numpy.add(a, b)SciPy:
scipy.add(a, b)SymPy:
a + bwhere you define vectors asMatrix.
8. Geometric Interpretation
Given two vectors and , their sum is represented geometrically:
The sum can be visualized as the diagonal of a parallelogram defined by vectors and .
The difference extended from towards is .
9. The Dot Product of 2 Vectors
9.1 Definition
The dot product of vectors and is defined as:
where is the angle between them.
9.2 Example Calculation
Example 9.1:
Let and :
. The dot product yields a scalar quantity.
9.3 Pythonic Implementation
You can calculate the dot product using:
NumPy:
numpy.dot(a, b)SciPy:
scipy.dot(a, b)SymPy:
a.dot(b)
10. The Angle Between Two Vectors
10.1 Calculation
The angle between two vectors can be calculated using the formula:
10.2 Examples
Example 10.1: Given and ,
Using the dot product:
10.3 Pythonic Implementation
Use numpy.arccos() or scipy.arccos() for calculating angles between vectors in Python.
11. Vector Space and Subspace
11.1 Definition
A vector space is a non-empty set of vectors equipped with two operations—addition and scalar multiplication—satisfying eight axioms.
11.2 Subspace Conditions
A non-empty subset of vector space is a subspace if:
For all , then .
For any scalar and , then .
11.3 Examples of Subspaces
Example 11.1: Let W = \left{ \begin{pmatrix} x\ y \end{pmatrix} \; | \; x,y \text{ are constants} \right} \; \cup \; {(0,0)}
11.4 Linear Combination and Spanning Set
A linear combination of vectors in vectors space is given by:
, where are scalars.
Example of Linear Combination
Express as a combination of two other vectors.
11.5 Linear Independence
A set of vectors is linearly independent if the only solution to the equation
is .
11.6 Basis of a Vector Space
A basis of a vector space consists of linearly independent vectors that span the space. For instance, the standard basis for is given as the vectors .
11.7 Dimension of a Vector Space
The dimension of a vector space is the number of vectors in a basis of .
11.8 Inner Product Space
An inner product space generalizes the dot product concept and defines a product between two vectors that results in a scalar:
.
11.9 Orthogonal and Orthonormal Bases
A set of vectors is called orthogonal if each pair is orthogonal, and orthonormal if they are also unit vectors. A framework can be adjusted to orthogonalize vectors using the Gram-Schmidt process.
12. Conclusion
All concepts discussed form the foundational principles for understanding Vectors in 3D Space. Proper knowledge of operations, properties, and their applications is crucial in both mathematics and physics contexts. The introduction of programming using libraries such as Python enhances the applicability of these mathematical concepts in computational environments. The importance of coding practices in numerical and symbolic calculations cannot be understated, offering efficiency and accuracy in calculations involving vectors.