File:Reciprocal monoclinic lattice.png
Reciprocal_monoclinic_lattice.png (516 × 318 pixels, file size: 126 KB, MIME type: image/png)
Captions
Captions
Summary
[edit]DescriptionReciprocal monoclinic lattice.png |
English: The Fourier transform of a monoclinic lattice with real-space vectors a = (1, 0, 0), b = (0, 1, 0), c = (0.5, 0, 0.8). (These vectors are arbitrary.) A 12×12×12 lattice of delta functions was used. The reciprocal lattice vectors are marked on in black. |
Date | |
Source | Own work |
Author | GKFX |
Generating code
[edit]Data points for this file were created with the following code:
#include <complex.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
double x, y, z;
} vector;
static inline vector mult_sv(double scalar, vector vec) {
vector r = { scalar * vec.x, scalar * vec.y, scalar * vec.z };
return r;
}
static inline vector add_vvv(vector v1, vector v2, vector v3) {
vector r = {
v1.x + v2.x + v3.x,
v1.y + v2.y + v3.y,
v1.z + v2.z + v3.z };
return r;
}
static inline double dot_vv(vector v1, vector v2) {
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
}
static inline int cube(int n) { return n*n*n; }
vector a = {1.0, 0.0, 0.0};
vector b = {0.0, 1.0, 0.0};
vector c = {0.5, 0.0, 0.8};
double meshStepLen = 10.0/64.0;
int nPerSide = 12;
int meshSideN = 100;
/*
* The Fourier transform of δ(x - a, y - b, z - c) is
* exp(i(aX + bY + cZ))
* --------------------
* (2√2)(√π)³
* using Mathematica's default definition of FT.
*/
double complex FTDD(vector realDDPos, vector reciprPos) {
return cexp(I * dot_vv(realDDPos, reciprPos)) /
(M_SQRT2 * M_2_SQRTPI * M_PI * M_PI);
}
int main() {
// Make progress bar work.
setvbuf (stdout, NULL, _IONBF, BUFSIZ);
vector *directLattice = (vector*) malloc(cube(nPerSide)*sizeof(vector));
{
vector *directLatticeTmp = directLattice;
for (int i = 0; i < nPerSide; i++) {
for (int j = 0; j < nPerSide; j++) {
for (int k = 0; k < nPerSide; k++) {
directLatticeTmp[0] = add_vvv(mult_sv(i, a), mult_sv(j, b), mult_sv(k, c));
directLatticeTmp++;
}
}
}
}
double complex *reciprocalLattice = (double complex*) malloc(cube(meshSideN)*sizeof(double complex));
for (int i = 0; i < cube(meshSideN); i++) {
reciprocalLattice[i] = 0.0;
}
{
double complex *reciprocalLatticeTmp = reciprocalLattice;
for (int i = 0; i < meshSideN; i++) {
putchar('.');
for (int j = 0; j < meshSideN; j++) {
for (int k = 0; k < meshSideN; k++) {
vector imagPoint = { i*meshStepLen, j*meshStepLen, k*meshStepLen };
for (int l = 0; l < cube(nPerSide); l++) {
reciprocalLatticeTmp[0] += FTDD(directLattice[l], imagPoint);
}
reciprocalLatticeTmp++;
}
}
}
}
printf(" Created complex lattice\n");
double *magData = (double*) malloc(cube(meshSideN)*sizeof(double));
for (int i = 0; i < cube(meshSideN); i++) {
magData[i] = cabs(reciprocalLattice[i]);
}
FILE *datafile = fopen("rlattice.bin", "wb");
if (!datafile) {
perror(0);
goto free_rlattice;
}
fwrite(magData, sizeof(double)*cube(meshSideN), 1, datafile);
fclose(datafile);
printf("\nDone.\n");
free_rlattice:
free(reciprocalLattice);
free(directLattice);
return 0;
}
It was then plotted in Mathematica.
Licensing
[edit]![]() ![]() |
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 23:11, 31 October 2019 | ![]() | 516 × 318 (126 KB) | GKFX (talk | contribs) | {{Information |description ={{en|1=The Fourier transform of a monoclinic lattice with real-space vectors '''a''' = (1, 0, 0), '''b''' = (0, 1, 0), '''c''' = (0.5, 0, 0.8). (These vectors are arbitrary.) A 12×12×12 lattice of delta functions was used.}} |date =2019-10-31 |source ={{own}} |author =User:GKFX }} Category:Reciprocal lattice Category:X-ray diffraction |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ar.wikipedia.org
- Usage on ca.wikipedia.org
- Usage on en.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on tr.wikipedia.org
- Usage on uk.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 28.35 dpc |
---|---|
Vertical resolution | 28.35 dpc |
Software used | |
Date and time of digitizing |
|