TABLE OF CONTENTS


::pwtk::coorToCrystal

SYNOPSIS

proc ::pwtk::coorToCrystal {latvec coor} {

PURPOSE

Transform Cartesian coordinates to crystal coordinates. It is assumed that unit-cell vectors and coordinates are in the same units.

ARGUMENTS

RETURN VALUE

SOURCE

    set crysCoor {}
    set Tinv [invert3x3 $latvec]
    
    foreach line [split [purifyCoor $coor] \n] {
        if { [llength $line] == 4 || [llength $line] == 7 } {
            set xyz [lassign $line asym]
            append crysCoor "$asym [::math::linearalgebra::matmul $xyz $Tinv]\n"
        }
    }
    return $crysCoor
}