Package: vectorise
vectoriseA Python package that implements and represents basic functionalities of Vectors.It is also available onGitHubInstallationNote :- Requires Python Version 3.xIf there are 2 or more versions of Python installed in your system (which mostly occurs in UNIX/Linux systems) then please run any one of the commands in the BASH/ZSH Shell :-pip3installvectorisepython3-mpipinstallvectoriseIf there is only Python 3.x installed in your system like in Windows systems then please run any one of commands in the Command Prompt :-pip install vectorisepython -m pip install vectoriseQuick GuidePlease Read till the EndImport the Package usingimport vectorise as vrvr.Vectorcreates a vector object.By Default it creates anull vector.It isMutablei.e after its creation the vector object can be changed by<Vector object>.{x, y, z} = value.Direction Ratios of a Vector can be retrieved by any of the following methods :-<Vector object>.xreturns the direction ratio on the X-axis unit vectori.<Vector object>.yreturns the direction ratio on the Y-axis unit vectorj.<Vector object>.zreturns the direction ratio on the Z-axis unit vectork.<Vector object>.directionRatios()returns atupleof the direction ratios ofi,j,krespectively.<Vector object>.directionCosines()returns atupleof the direction cosines ofi,j,krespectively.<Vector object>.directionAngles()returns atupleof the direction angles ofi,j,krespectively.Magnitude of a Vector can be retrieved by any of the following methods:-<Vector object>.magnitude()returns theexact magnitudeof the Vector.len(<Vector object>)returns theapproximate magnitudeof the Vector.Please Note :- This is specific to this version and the upcoming versions.<Vector object>.toUnit()converts the given Vector to unit vector and returns it.All the Arithmetic Operations (includingUnary Negation), exceptMultiplication; can be done using their usual symbols.<Vector object>.dot(<Vector object>)returns theDot Productof the given 2 Vectors, which would be aScalari.e either anintegeror afloating point number.<Vector object>.cross(<Vector object>)returns theCross Productof the given 2 Vectors, which would be another instance of Vector.- <Vector object>returns a Vector which is in the opposite direction to the given Vector.Please Note :- This is specific to this version and the upcoming versions.<Vector object>.makesAngleWith(<Vector object>)returns theanglebetween the given 2 Vectors.<Vector object>.projectionOn(<Vector object>)returns the projection of the self Vector over the Vector passed in.<Vector object>.projectionVectorOn(<Vector object>)returns the projection Vector of the self Vector over the Vector passed in.Please Note :- All the Returned Angles are in DEGREES, NOT IN RADIANS; so as to make calculations and understandability effortless.Have Fun Learning!!!A Sample ImplementationfromvectoriseimportVectorv1=Vector(-3,4,5)v2=Vector(21,-54,-101)v3=Vector(-3,4,5)print("V1 :",v1,"\nV2 :",v2,"\nV3 :",v3)print("\nV1 == V2 :",v1==v2)print("V1 == V3 :",v1==v3)print("\nDirection Angles of V1 :",v1.directionAngles())print("Direction Angles of V2 :",v2.directionAngles())print("\nDirection Ratios of V1 :",v1.directionRatios())print("Direction Ratios of V2 :",v2.directionRatios())print("\nDirection Cosines of V1 :",v1.directionCosines())print("Direction Cosines of V2 :",v2.directionCosines())print("\n|V1| :",v1.magnitude(),"\n|V2| :",v2.magnitude())print("\nUnit Vector of V1 :",v1.toUnit(),"\nUnit Vector of V2 :",v2.toUnit())print("\nV1 + V2 :",v1+v2)print("V1 - V2 :",v1-v2)print("\nV1 * 2 :",v1*2)print("V2 * 3 :",v2*3)print("\n-V1 :",-v1)print("-V2 :",-v2)print("\nV1 . V2 :",v1.dot(v2))print("V1 X V2 :",v1.cross(v2))print("V2 X V1 :",v2.cross(v1))print("\nAngle between V1 and V2 :",v1.makesAngleWith(v2))print("\nProjection Vector of V1 on V2 :",v1.projectionVectorOn(v2))print("Projection Vector of V2 on V1 :",v2.projectionVectorOn(v1))print("\nProjection of V1 on V2 :",v1.projectionOn(v2))print("Projection of V2 on V1 :",v2.projectionOn(v1))