Sagemath Practical PDF 3
Sagemath Practical PDF 3
Procedure:
Step 3: Compute the dot product of the cross product with the third vector.
Step 4: Display the result, which represents the volume of the parallelepiped formed by
the vectors.
Code:
Result:
Hence, the got the solution for the given equation using SageMath.
2. Vector Projection of One Vector onto Another:
Procedure:
Code:
Output:
Result:
Hence, the got the solution for the given equation using SageMath.
3. Three Vectors are Coplanar or not:
Procedure:
Step 2: Calculate the triple scalar product using the cross product and dot product
methods.
Code:
Sage: if triple_scalar_product == 0:
Sage: else:
Output:
Result:
Hence, the got the solution for the given equation using SageMath.
4. Angle Between Two Vectors
Procedure:
Code:
Result: Hence, the got the solution for the given equation using SageMath.
5. Point of Intersection of Two 2D Lines
Procedure:
a1x+b1y=c1
a2x+b2y=c2
a1 a2 . x c1
b1 b2 y = c2
Step 3: Solve for (x,y)(x, y)(x,y) using the matrix inverse method.
Step 4: If the determinant of the coefficient matrix is zero, the lines are either parallel or
identical, meaning they have no unique intersection.
Code:
Sage: if A.det() != 0:
Sage: else:
Hence, the got the solution for the given equation using SageMath.