The elemental metal is rarely found in nature, but once isolated artificially, the formation of an oxide layer ( passivation) somewhat stabilizes the free metal against further oxidation.Īndrés Manuel del Río discovered compounds of vanadium in 1801 in Mexico by analyzing a new lead-bearing mineral he called "brown lead". It is a hard, silvery-grey, malleable transition metal. = v1.rotate(angle=a, axis=vector(x,y,z)).Vanadium is a chemical element with the symbol V and atomic number 23. (0,0,1), for a rotation in the xy plane around the z axis. V2 = rotate(v1, angle=a, axis=vector(x,y,z)) There is a function for rotating a vector: Two vectors are normalized, the dot product gives the cosine of the angleīetween the vectors, which is often useful. Which is an ordinary number equal to mag(A)*mag(B)*cos(diff_angle(A,B)). The magnitude of this vector is equal mag(A)*mag(B)*sin(diff_angle(A,B)).ĭot(A,B) or A.dot(B) gives the dot product of two vectors, Hand bend from A toward B, the thumb points in the direction In a direction defined by the right-hand rule: if the fingers of the right Ĭross(A,B) or A.cross(B) gives the cross product of two vectors, a vector perpendicular to the plane defined by A and B, Magnitude, the difference of the angles is calculated to be zero. For convenience, if either of the vectors has zero To calculate the angle between two vectors (the "difference" V2.hat = v1 # changes the direction of v2 to that of v1 You can change the direction of a vector without changing its magnitude: Norm(A) # A/|A|, normalized magnitude of 1 You can reset the magnitude to 1 with norm(): V2.mag2 = 2.7 # sets squared magnitude of v2 to V2.mag = 5 # sets magnitude to 5 no change in direction It is possible to reset the magnitude or the Vector.random() produces a vector each of whose components is a random number in the range -1 to +1 Proj(A,B) = A.proj(B) = dot(A,norm(B))*norm(B), the vector projection of A along BĬomp(A,B) = A.comp(B) = dot(A,norm(B)), the scalar projection of A along BĪ.equals(B) is True if A and B have the same components (which means that they have the same magnitude and the same direction). Norm(A) = A.norm() = A/|A|, a unit vector in the direction of the vectorĪ/|A|, a unit vector in the direction of the vector an alternative to A.norm(), based on the fact that unit vectors are customarily written in the form ĉ, with a "hat" over the vectorįor convenience, norm(vec(0,0,0)) or vec(0,0,0).hat is calculated to be vec(0,0,0).ĭot(A,B) = A.dot(B) = A dot B, the scalar dot product between two vectorsĬross(A,B) = A.cross(B), the vector cross product between two vectorsĭiff_angle(A,B) = A.diff_angle(B), the angle between two vectors, in radians Mag2(A) = A.mag2 = |A|*|A|, the vector's magnitude squared
Mag(A) = A.mag = |A|, the magnitude of a vector The following functions are available for working with vectors: This is a convenient way to make a separate copy of a vector.
It is okay to make a vector from a vector: vector(v2) is still vector(10,20,30). You can refer to individual components of a vector: Vectors can be added or subtracted from each other, or multiplied by an This creates a 3D vector object with the given components x, y, and z. The vector object is not a displayable object but isĪ powerful aid to 3D computations.