- #1
pushkalcodes
- 2
- 0
Hi all,
I have been trying to write code to convert from cartesian to fractional coordinates. I think everything is correct in my code (i have used wikipedia as reference - http://en.wikipedia.org/wiki/Fractional_coordinates), but still, the code doesn't work for some test values. The code is here http://codepad.org/sOV5ws5R. The code has the test data in there, if you want to check.
Could there be something wrong with the orientation of the axes? In wikipedia it has been assumed that cartesian coordinate axes X is in line with the lattice vector 'a'. It might be that the data I have doesn't correspond to this scheme (that the lattice vector 'a' is taken along x-axis). How to check if this the data which I have adheres to this scheme or is some other axis is directional along x-axis?
Other references that might be helpful -
http://www.angelfire.com/linux/myp/FracCor/fraccor.html
http://cci.lbl.gov/cctbx/frac_cart.html
I have really tried hard to find a solution for this, but couldn't find out where I am going wrong.
Thanks for your time.
I have been trying to write code to convert from cartesian to fractional coordinates. I think everything is correct in my code (i have used wikipedia as reference - http://en.wikipedia.org/wiki/Fractional_coordinates), but still, the code doesn't work for some test values. The code is here http://codepad.org/sOV5ws5R. The code has the test data in there, if you want to check.
Could there be something wrong with the orientation of the axes? In wikipedia it has been assumed that cartesian coordinate axes X is in line with the lattice vector 'a'. It might be that the data I have doesn't correspond to this scheme (that the lattice vector 'a' is taken along x-axis). How to check if this the data which I have adheres to this scheme or is some other axis is directional along x-axis?
Other references that might be helpful -
http://www.angelfire.com/linux/myp/FracCor/fraccor.html
http://cci.lbl.gov/cctbx/frac_cart.html
I have really tried hard to find a solution for this, but couldn't find out where I am going wrong.
Thanks for your time.
Last edited by a moderator: