# Vector3d#

class orix.vector.Vector3d(data=None)[source]#

Bases: Object3d

Vector base class.

Vectors support the following mathematical operations:
• Unary negation.

• Addition to other vectors, scalars, numbers, and compatible array-like objects.

• Subtraction to and from the above.

• Multiplication to scalars, numbers, and compatible array-like objects.

• Division by the same as multiplication. Division by a vector is not defined in general.

Examples

>>> from orix.vector import Vector3d
>>> v = Vector3d((1, 2, 3))
>>> w = Vector3d(np.array([[1, 0, 0], [0, 1, 1]]))
>>> w.x
array([1, 0])
>>> v.unit
Vector3d (1,)
[[0.2673 0.5345 0.8018]]
>>> -v
Vector3d (1,)
[[-1 -2 -3]]
>>> v + w
Vector3d (2,)
[[2 2 3]
[1 3 4]]
>>> w - (2, -3)
Vector3d (2,)
[[-1 -2 -2]
[ 3  4  4]]
>>> 3 * v
Vector3d (1,)
[[3 6 9]]
>>> v / 2
Vector3d (1,)
[[0.5 1.  1.5]]
>>> v / (2, -2)
Vector3d (2,)
[[ 0.5  1.   1.5]
[-0.5 -1.  -1.5]]


Attributes

 Vector3d.azimuth Azimuth spherical coordinate, i.e. the angle $$\phi \in [0, 2\pi]$$ from the positive z-axis to a point on the sphere, according to the ISO 31-11 standard . Vector3d.dim Return the number of dimensions for this object. Vector3d.perpendicular Return the perpendicular vectors. Vector3d.polar Polar spherical coordinate, i.e. the angle $$\theta \in [0, \pi]$$ from the positive z-axis to a point on the sphere, according to the ISO 31-11 standard . Vector3d.radial Return the radial spherical coordinate, i.e. the distance from a point on the sphere to the origin, according to the ISO 31-11 standard . Vector3d.x Return or set the x coordinates. Vector3d.xyz Return the coordinates as three arrays, useful for plotting. Vector3d.y Return or set the y coordinates. Vector3d.z Return or set the z coordinate.

Methods

 Calculate the angles between these vectors in other vectors. Vector3d.cross(other) The cross product of a vector with another vector. Vector3d.dot(other) Return the dot products of the vectors and the other vectors. Vector3d.dot_outer(other[, lazy, ...]) Return the outer dot products of all vectors and all the other vectors. Vector3d.draw_circle([projection, figure, ...]) Draw great or small circles with a given opening_angle to to the vectors in the stereographic projection. Vector3d.from_polar(azimuth, polar[, radial]) Create a Vector3d from spherical coordinates according to the ISO 31-11 standard . Vector3d.get_circle([opening_angle, steps]) Get vectors delineating great or small circle(s) with a given opening_angle about each vector. Vector3d.get_nearest(x[, inclusive, tiebreak]) Return the vector in x with the smallest angle to this vector. Vector3d.in_fundamental_sector(symmetry) Project vectors to a symmetry's fundamental sector (inverse pole figure). Plot the Inverse Pole Density Function (IPDF) within the fundamental sector of a given point group symmetry in the stereographic projection. Return the mean vector. Vector3d.pole_density_function([resolution, ...]) Plot the Pole Density Function (PDF) on a given hemisphere in the stereographic projection. Vector3d.rotate([axis, angle]) Convenience function for rotating this vector. Vector3d.scatter([projection, figure, ...]) Plot vectors in the stereographic projection. Return the azimuth $$\phi$$, polar $$\theta$$, and radial $$r$$ spherical coordinates, the angles in radians. Return a unit vector in the x-direction. Return a unit vector in the y-direction. Vector3d.zero([shape]) Return zero vectors in the specified shape. Return a unit vector in the z-direction.