A method of vector3d.
the direction with its indices, or its coordinates, rounded to small integers
Syntax
m = round(m)
The indices of the display rounded.
m = round(m, maxHKL=5)
No index larger than 5.
m = round(m, 'uvw')
The direct indices integer.
v = round(v, maxXYZ=5)
The Cartesian coordinates of a vector.
v = round(v, accuracy=0.1*degree)
Rounded only where it turns by less.
m, err = round(m, return_error=True)
Also the angle the rounding turned it by.
Description
The direction is scaled so that its largest index is 1, 2, …, maxHKL, and the scale that brings the indices nearest to integers is kept. For a trigonal or hexagonal lattice the three and the four index forms are not integer at the same time, UVTW = (1, 3, -4, 8) is uvw = (5, 7, 8)/3, so style says which is rounded. A vector without a lattice has its Cartesian coordinates rounded and keeps them where the rounding would turn it by more than the accuracy.
Input
m |
vector3d in a crystal frame |
v |
vector3d |
Keywords
| keyword | default | description |
|---|---|---|
style |
None |
the indices rounded, ‘hkl’, ‘hkil’, ‘uvw’ or ‘UVTW’; by default those of the display |
maxHKL |
12 |
the largest index of a crystal direction |
maxXYZ |
12 |
the largest coordinate of a vector without a lattice |
accuracy |
1*degree |
the largest angle the rounding may turn a vector without a lattice by, in radians |
return_error |
False |
also return the angle the rounding turned the directions by |
Output
m, v |
vector3d, the rounded directions |
err |
array, the angle between the given and the rounded direction, without symmetric equivalents, with return_error=True |
See also
vector3d.char, Miller, CrystalDirections
Used on
NotationAndConventions, EllipseBasedParameters, OrientationRelationshipFit, MagneticAnisotropy
MATLAB’s vector3d.round
source
Citing this page.
This page is part of the documentation of
MTEX, a free and open
source MATLAB toolbox for analyzing and modeling crystallographic textures.
It was written by The MTEX Developers and is published at
https://mtex-toolbox.github.io/vector3d.round_py.html.
If you use MTEX, or reuse text or figures from this page, in your research,
please cite
F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63
BibTeX
@article{bachmann2010mtex,
author = {F. Bachmann and R. Hielscher and H. Schaeben},
title = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
journal = {Solid State Phenomena},
volume = {160},
pages = {63-68},
year = {2010},
doi = {10.4028/www.scientific.net/SSP.160.63},
url = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}
Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.