coord.src
来自「没有说明」· SRC 代码 · 共 52 行
SRC
52 行
/*
** coord.src
** (C) Copyright 1988-1998 by Aptech Systems, Inc.
** All Rights Reserved.
**
** This Software Product is PROPRIETARY SOURCE CODE OF APTECH
** SYSTEMS, INC. This File Header must accompany all files using
** any portion, in whole or in part, of this Source Code. In
** addition, the right to create such files is strictly limited by
** Section 2.A. of the GAUSS Applications License Agreement
** accompanying this Software Product.
**
** If you wish to distribute any portion of the proprietary Source
** Code, in whole or in part, you must first obtain written
** permission from Aptech Systems.
*/
#ifcplx
proc ( 2 ) = topolar(x);
if iscplx(x);
retp(sqrt(real(x)^2+imag(x)^2),atan2(imag(x),real(x)));
else;
retp(x,imag(x));
endif;
endp;
proc tocart(r,theta);
if iscplx(r);
if hasimag(r);
errorlog "R cannot be a complex matrix.";
if iscplx(theta);
errorlog "THETA cannot be a complex matrix.";
endif;
end;
else;
r = real(r);
endif;
endif;
if iscplx(theta);
if hasimag(theta);
errorlog "THETA cannot be a complex matrix.";
end;
else;
theta = real(theta);
endif;
endif;
retp(complex(r.*cos(theta),r.*sin(theta)));
endp;
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?