📄 mainwzrectangulartest.html
字号:
<TITLE>COG 2.1: Rectangular coordinates</TITLE><H1>Rectangular Coordinates</H1> <P>Rectangular coordinates are compositions of <A HREF="mainwz1dmaps.html">1D coordinates</A>. The 1D coordinatesthemself are rectangular coordinates in this sense too. But the moreinteresting case are compositions of 1D coordinates into <A HREF="mainwz2dmaps.html">2D coordinates</A> defined by the class<B>wz2Drectangular</B> and into <A HREF="mainwz3dmaps.html">3D coordinates</A> by<B>wz3Drectangular</B>:<PRE>#include "coglib.hxx"int main(){ wz1dmap cx = new wz1Dexp(); wz1dmap cy = new wz1Dsinh(); wz1dmap cz = new wz1Datan(); wz2dmap c2 = new wz2Drectangular(cx,cy); wz3dmap c3 = new wz3Drectangular(cx,cy,cz);</PRE> <P>There is also a similar way to compose 2D coordinates with 1Dcoordinates to 3D cylindrical coordinates:<PRE> wz3dmap c4 = new wz3Dcylindrical(c2,cz);</PRE> <P>defines the same system of coordinates as c3 (in a slightly slowerimplementation).<H2>Values, affine transformations</H2> <P>Value computation and affine transformations are as usual for <A HREF="mainwz2dmaps.html">2D</A> resp. <A HREF="mainwz3dmaps.html">3D</A> coordinates. <P>The usual print method can be used:<PRE> c2->print(); c3->print(); c4->print();</PRE><H2>Compositions</H2> <P>An essential difference to usual coordinates is that there areother composition operations - the natural composition operations.Once they are not defined for the proxy classes <I>wz2dmap</I>resp. <I>wz3dmap</I>, we have to define them for the classesthemself:<PRE> wz2Drectangular *d2 = new wz2Drectangular(); wz3Drectangular *d3 = new wz3Drectangular(); wz3Dcylindrical *d4 = new wz3Dcylindrical(); d2->composeX(cx); d2->composeY(cy); d3->composeX(cx); d3->composeY(cy); d3->composeZ(cz); d4->composeXY(c2); d4->composeZ(cz);</PRE> <P>Note that, while we have named these coordinates rectangular, theyare no longer rectangular after rotating them. So, don't wonder ifthe coordinates are named rectangular and, below, it is written thatthey are not - that's correct:<PRE> d3->rotateZ(0.1); d3->print(); fine();}</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -