Miller-Bravais to xyz conversion

547 views
Skip to first unread message

grandr...@gmail.com

unread,
Jul 22, 2016, 9:59:42 PM7/22/16
to mtex...@googlegroups.com
For a script I'm working on I want to convert a Miller Bravais HCP direction into an x,y,z (ie orthogonal crystal axis) vector

Using b= Miller(1,0,-1,1,cs,'uvw') and doing this manually, I convert it into rhombohedral coordinates using [u-t,v-t,w] and get [2,1,1] (call this R).  This can then be converted into xyz orthogonal coordinates using
A=[1,-1/2,0;0,(sqrt(3)/2),0;0,0,c/a]  followed by A*R  (where c/a is based on the crystallography of that alloy) which outputs [1.5,0.866,1.6236]

Of course the whole method changes when you're dealing with planes.

So I have three questions;
1.  Is there a function that does this automatically?  I can program it myself, no big issue but I'm curious
2.  when I go into variable b, I notice that the values stored there for x,y,z are completely different.  What do these values represent?
3.  to confirm, I can force the system to consider this as an orthogonal vector by calling it as
Miller(0.5,-0.866,1.6236,cs,'xyz')

I appreciate any help you can offer,

Regards, Jessica

Rüdiger Kilian

unread,
Jul 23, 2016, 2:59:46 AM7/23/16
to mtex...@googlegroups.com
Hi Jessica,
I would have thought .xyz would be what you are looking for.
Doing:

cs=crystalSymmetry('321')
hs= Miller(1,1,-2,2,cs,'uvw')
plot(hs,'MarkerSize',25)
hold on
plot(vector3d(hs.xyz),[1,0,0],'MarkerSize',15)
hold off

looks like both are ending up on the same spot. Maybe that helps.
Cheers,
Rüdiger





From: mtex...@googlegroups.com [mtex...@googlegroups.com] on behalf of grandr...@gmail.com [grandr...@gmail.com]
Sent: Saturday, July 23, 2016 3:59 AM
To: MTEX
Subject: {MTEX} Miller-Bravais to xyz conversion

For a script I'm working on I want to convert a Miller Bravais HCP direction into an x,y,z (ie orthogonal crystal axis) vector

Using b= Miller(1,0,-1,1,cs,'uvw') and doing this manually, I convert it into rhombohedral coordinates using [u-t,v-t,w] and get [0,-1,1] (call this R).  This can then be converted into xyz orthogonal coordinates using
A=[1,-1/2,0;0,(sqrt(3)/2),0;0,0,c/a]  followed by A*R  (where c/a is based on the crystallography of that alloy) which outputs [0.5,-0.866,1.6236]


Of course the whole method changes when you're dealing with planes.

So I have three questions;
1.  Is there a function that does this automatically?  I can program it myself, no big issue but I'm curious
2.  when I go into variable b, I notice that the values stored there for x,y,z are completely different.  What do these values represent?
3.  to confirm, I can force the system to consider this as an orthogonal vector by calling it as
Miller(0.5,-0.866,1.6236,cs,'xyz')


I appreciate any help you can offer,

Regards, Jessica

--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

David Mainprice

unread,
Jul 23, 2016, 4:27:15 AM7/23/16
to mtex...@googlegroups.com
Here are some examples of conversions in MTEX4, this can be  hkil or hkl 

%% Conversion between hkl (or hkil) and uvw (or uvtw) and specimen coordinates

% N.B. converted uvw and hkl not always integer values
h = Miller(1,1,1,CS,'Forsterite','hkl')
% change hkl (h) to uvw
uvw = h.uvw
u = Miller(1,1,1,CS,'Forsterite','uvw')
% change uvw (u) to hkl
hkl = u.hkl
%% conversion of hkl and uvw to specimen coordinates
% N.B. converted uvw and hkl not always integer values
% change hkl (h) to vector3d r1
% Miller indices h parallel to specimen direction r1
r1 = vector3d(h)
% change uvw (u) to vector3d r2
% Miller indices u parallel to specimen direction r2
r2 = vector3d(u)
%% conversion of specimen coordinates to hkl and uvw
% N.B. converted uvw and hkl not always integer values
% change vector3d(1,1,1) to hkl
hkl_111 = Miller(vector3d(1,1,1),CS,'Forsterite','hkl')
% change vector3d(1,1,1) to uvw
uvw_111 = Miller(vector3d(1,1,1),CS,'Forsterite','uvw’)

all the best David


Le 23 juil. 2016 à 03:59, grandr...@gmail.com a écrit :

For a script I'm working on I want to convert a Miller Bravais HCP direction into an x,y,z (ie orthogonal crystal axis) vector

Using b= Miller(1,0,-1,1,cs,'uvw') and doing this manually, I convert it into rhombohedral coordinates using [u-t,v-t,w] and get [0,-1,1] (call this R).  This can then be converted into xyz orthogonal coordinates using
A=[1,-1/2,0;0,(sqrt(3)/2),0;0,0,c/a]  followed by A*R  (where c/a is based on the crystallography of that alloy) which outputs [0.5,-0.866,1.6236]


Of course the whole method changes when you're dealing with planes.

So I have three questions;
1.  Is there a function that does this automatically?  I can program it myself, no big issue but I'm curious
2.  when I go into variable b, I notice that the values stored there for x,y,z are completely different.  What do these values represent?
3.  to confirm, I can force the system to consider this as an orthogonal vector by calling it as
Miller(0.5,-0.866,1.6236,cs,'xyz')


I appreciate any help you can offer,

Regards, Jessica

grandr...@gmail.com

unread,
Jul 23, 2016, 11:07:40 PM7/23/16
to MTEX

This was very helpful, I am having a lot of difficulty with orienting things correctly in my code but I will put in a new question since the issue is a bit different.  Thank you for helping me sort this out.

Jessica

Reply all
Reply to author
Forward
0 new messages