add proc cinv (complex inversion)
This commit is contained in:
parent
936b72c7fc
commit
fc3a3ed4e0
|
|
@ -760,6 +760,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
<li><kbd> bbox </kbd> bounding box schematic </li>
|
||||
<li><kbd> bbox_hilighted </kbd> bounding box of highlinhted objects </li>
|
||||
<li><kbd> bbox_selected </kbd> bounding box of selected objects </li>
|
||||
<li><kbd> build_date </kbd> time and date this file was built. </li>
|
||||
<li><kbd> cadlayers </kbd> number of layers </li>
|
||||
<li><kbd> case_insensitive </kbd> case_insensitive symbol matching </li>
|
||||
<li><kbd> color_ps </kbd> color postscript flag </li>
|
||||
|
|
|
|||
|
|
@ -1344,6 +1344,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
my_snprintf(res, S(res), "%g %g %g %g", boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
|
||||
Tcl_SetResult(interp, res, TCL_VOLATILE);
|
||||
}
|
||||
else if(!strcmp(argv[2], "build_date")) { /* time and date this file was built. */
|
||||
char date[] = __DATE__ " : " __TIME__;
|
||||
Tcl_SetResult(interp, date, TCL_STATIC);
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
if(!strcmp(argv[2], "cadlayers")) { /* number of layers */
|
||||
|
|
|
|||
|
|
@ -731,6 +731,17 @@ proc cdiv {a b} {
|
|||
return $c
|
||||
}
|
||||
|
||||
# 1/b
|
||||
proc cinv {b} {
|
||||
|
||||
lassign $b rb ib
|
||||
set rb [expr {double($rb)}]
|
||||
set ib [expr {double($ib)}]
|
||||
set m [expr {$rb * $rb + $ib * $ib}]
|
||||
set c [list [expr {$rb / $m}] [expr {-$ib / $m}]]
|
||||
return $c
|
||||
}
|
||||
|
||||
# return real component
|
||||
proc creal {a} {
|
||||
lassign $a ra ia
|
||||
|
|
|
|||
Loading…
Reference in New Issue