Skip to contents

This represents a crystal unit cell.

Usage

unit_cell(a = NULL, b = NULL, c = NULL, aa = NULL, bb = NULL, cc = NULL)

Arguments

a

A real number. One of the unit cell's side lengths, in angstroms.

b

A real number. One of the unit cell's side lengths, in angstroms.

c

A real number. One of the unit cell's side lengths, in angstroms.

aa

A real number. One of the unit cell's angles, in degrees.

bb

A real number. One of the unit cell's angles, in degrees.

cc

A real number. One of the unit cell's angles, in degrees.

Value

An object of class "unit_cell". It is a named list of length 6 whose last three slots are of "angle" class.

Details

The constructor can be used with less than the full set of six input parameters, to create unit cells for the cubic, tetragonal and orthogonal systems. Objects of "unit_cell" class can also be created with no parameters (default to a cubic cell of side length 10 angstroms).

Examples

# Create a monoclinic unit cell
uc <- unit_cell(10,30,15,90,60,90)
print(uc)
#> This is an object of class 'unit_cell'
#> Its sides are:
#>       10.000 ,     30.000 ,     15.000    angstroms.
#> Its angles are:
#>       90.000 ,     60.000 ,     90.000    degrees.

# Create a cubic cell (default)
uc <- unit_cell()
print(uc)
#> This is an object of class 'unit_cell'
#> Its sides are:
#>       10.000 ,     10.000 ,     10.000    angstroms.
#> Its angles are:
#>       90.000 ,     90.000 ,     90.000    degrees.

# Create a cubic cell with side 20
uc <- unit_cell(20)
print(uc)
#> This is an object of class 'unit_cell'
#> Its sides are:
#>       20.000 ,     20.000 ,     20.000    angstroms.
#> Its angles are:
#>       90.000 ,     90.000 ,     90.000    degrees.

# Create a tetragonal unit cell with sides 20 and 60
uc <- unit_cell(20,60)
print(uc)
#> This is an object of class 'unit_cell'
#> Its sides are:
#>       20.000 ,     20.000 ,     60.000    angstroms.
#> Its angles are:
#>       90.000 ,     90.000 ,     90.000    degrees.

# Create an orthogonal unit cell
uc <- unit_cell(40,15,30)
print(uc)
#> This is an object of class 'unit_cell'
#> Its sides are:
#>       40.000 ,     15.000 ,     30.000    angstroms.
#> Its angles are:
#>       90.000 ,     90.000 ,     90.000    degrees.