enter image description here

I'm trying to define an oblique plane with the points A, B and C to use in a scope environment and then draw a circle in it using 2D. In previous drawings I managed to get away with options like canvas is xy plane at z= but this time I'm not seeing how I can do that.

Is there a way to define planes to draw in using three points? How may I define that plane to draw? Using x={(a1,b1,c1)} and y={(a2,b2,c2)}?

Right now, what I have is this:



        \foreach \i in {0,3}{
            \begin{scope}[canvas is xy plane at z=\i]
                \tkzDefPoints{0/0/O\i, 2/0/A\i}
                    \tkzLabelRegPolygon(O\i){P1\i,P2\i, P3\i, P4\i,P5\i,P6\i, P7\i, P8\i}
                \tkzDrawPolygon(P1\i,P2\i, P3\i, P4\i,P5\i,P6\i, P7\i, P8\i)
        \foreach \i in {1,...,8}{
            \draw (P\i0) -- (P\i3);

Any help is massively appreciated!

1 Answer 1


You can compute the basis vectors of the plane. This can be done by computing cross products of differences between the three points, and normalizing them. (I use a slightly modified version of \tdplotcrossprod because the built-in version tends to swallow signs.) To illustrate this I draw a circle at the barycenter of the three points but you can adjust this to your needs. BTW, tkz-euclide does not bring great advantages in this scenario, but unfortunately it obscures the components of the coordinate, which is fine in 2d but not in 3d when you need them for further operations, so I dropped it.

        declare function={x8(\i)=2*cos(\i*45-45);
        \path foreach \j in {0,3} {foreach \i in {1,...,8}
        {({x8(\i)},{y8(\i)},{\j}) coordinate (P\i\j)}};
        \draw foreach \j in {0,3}
         {plot[samples at={1,...,8}] (P\x\j) -- cycle};
        \foreach \i in {1,...,8}{
            \draw (P\i0) -- (P\i3);
        \path (P13) node[above] {$A$} (P63) node[above] {$B$}
          (P30) node[right] {$C$};
            \pgfmathsetmacro{\tdplotresx}{(#2) * (#6) - (#3) * (#5)}% 
            \pgfmathsetmacro{\tdplotresy}{(#3) * (#4) - (#1) * (#6)}% 
            \pgfmathsetmacro {\tdplotresz }{(#1) * (#5) - (#2) * (#4)}}
        % compute the normal on the plane
        % compute the x-vector of the plane
        % compute the y-vector of the plane
        \typeout{(ex)=(\exx,\exy,\exz), (ey)=(\eyx,\eyy,\eyz), (ez)=(\nAx,\nAy,\nAz)}
        \path (\exx,\exy,\exz) coordinate (ex)
            (\eyx,\eyy,\eyz) coordinate (ey)
            (\nAx,\nAy,\nAz) coordinate (ez)
            ({(x8(1)+x8(3)+x8(6))/3},{(y8(1)+y8(3)+y8(6))/3},2) coordinate (P);
        \begin{scope}[x={(ex)},y={(ey)},z={(ez)}]%,canvas is xy plane at z=0]
         \draw (P) circle[radius=1];

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .