Changeset 1102 for branches/sandbox


Ignore:
Timestamp:
Dec 21, 2010 11:19:01 AM (10 years ago)
Author:
toby
Message:

make rb tcl8.4 compatible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/rb.tcl

    r1101 r1102  
     1# test code (package already loaded in expgui)
     2lappend auto_path [file dirname [info script]]
     3package require La
     4
    15#============================================================================
    26# rigid body EXP editing (to move into readexp.tcl)
     
    323327#============================================================================
    324328
    325 package require La
    326 
    327329# Use the GSAS geometry program to compute a set of cartesian coordinates for a
    328330# set of atoms in a .EXP file and provide the origin shift and Euler angles needed to
     
    506508    set CBSTAR [expr { ($CA*$CG-$CB)/($SA*$SC) }]    ;#! cos(Beta*)
    507509    set CCSTAR [expr { ($CA*$CB-$CG)/($SA*$SB) }]    ;#! cos(Gamma*)
    508     set SASTAR [expr { sqrt(max(0.0,1.0-$CASTAR**2)) }]    ;#! sin(Alpha*)
    509     set SBSTAR [expr { sqrt(max(0.0,1.0-$CBSTAR**2)) }]    ;#! sin(Beta*)
    510     set SCSTAR [expr { sqrt(max(0.0,1.0-$CCSTAR**2)) }]    ;#! sin(Gamma*)
     510    set SASTAR [expr { sqrt(1.0-($CASTAR*$CASTAR*2)) }]    ;#! sin(Alpha*)
     511    set SBSTAR [expr { sqrt(1.0-($CBSTAR*$CBSTAR*2)) }]    ;#! sin(Beta*)
     512    set SCSTAR [expr { sqrt(1.0-($CCSTAR*$CCSTAR*2)) }]    ;#! sin(Gamma*)
    511513
    512514    set A  "2 3 3      $a 0 0    0 $b 0    0 0 $c"
     
    626628        foreach var {x y z} v1 $frac v2 $coord abc [lrange $cell 0 2] {
    627629            set dv [expr {($v2 - $v1)}]
    628             set dvs [expr {$dvs + $dv**2}]
    629             set sumdvs [expr {$sumdvs + $dv**2}]
     630            set dvs [expr {$dvs + $dv*$dv}]
     631            set sumdvs [expr {$sumdvs + $dv*$dv}]
    630632            if {$use} {set sum($var) [expr {$sum($var) + $dv}]}
    631633        }
Note: See TracChangeset for help on using the changeset viewer.