回复 2# isee
确实挺麻烦的,刚才问了maven网友,他教了我一个方法,最后画出来的感觉还不错,但是也需要计算点的坐标。
我是用Mathematica软件计算的这些点的坐标,有的地方还不明白。把他跟我说的整理一下就是下面这些:
phi=Pi/4
alpha=Pi/4
beta=3Pi/4
gamma=Pi/2
AA = {{Cos[phi], -Sin[phi], 0, 0},{Sin[phi], Cos[phi], 0, 0},{0, 0, 1, 0},{0, 0, 0, 1}}
BB =
{{0, Csc[alpha]*Cos[gamma], -Csc[alpha] Cos[beta], 0},
{-Sin[alpha], Cot[alpha] Cos[beta], Cot[alpha] Cos[gamma], 0},
{Cos[alpha], Cos[beta], Cos[gamma], 0},
{0, 0, 0, 1}}
pl = Inverse[BB].AA.BB
n1=0
n2=1
n3=0
v1=1
v2=-3/2
v3=1/2
d1=v1*n1+v2*n2+v3*n3
pp = {{d1-v1*n1, -v1*n2, -v1*n3, 0}, {-v2*n1, d1-v2*n2, -v2*n3, 0}, {-v3*n1, -v3*n2, d1-v3*n3, 0}, {0, 0, 0, d1}}/d1
下面的这个是立方体坐标,这个我能看懂。
V = {{0, 0, 0, 1}, {4, 0, 0, 1}, {4, 4, 0, 1}, {0, 4, 0, 1}, {0, 0, 4, 1}, {4, 0, 4, 1}, {4, 4, 4, 1}, {0, 4, 4, 1}}
VV1 = pl.Transpose[V]
VV2 = pl.Transpose[V]
VV2[[3]] = {0, 0, 0, 0, 0, 0, 0, 0}
Simplify[Transpose[pp.VV1]],这里是立方体各顶点在平面$\theta$上的坐标(这里网友说是平面$\theta$,我觉得不是,应该是pdf的这个平面上的坐标,平面$\theta$上的坐标感觉还好算一点)
Simplify[Transpose[pp.VV2]],这里是顶点的各垂足在平面$\theta$上的坐标
算出来以后就能用tikz画了,代码:- \begin{tikzpicture}
- \coordinate (A) at (0,0);
- \coordinate (B) at ({(2+5*sqrt(2))/3},{(4+sqrt(2))/3});
- \coordinate (C) at ({10*sqrt(2)/3},{2*(6+sqrt(2))/3});
- \coordinate (D) at ({(-2+5*sqrt(2))/3},{(8+sqrt(2))/3});
- \coordinate (A_1) at ({-10/3},{-2/3+2*sqrt(2)});
- \coordinate (B_1) at ({(-8+5*sqrt(2))/3},{(2+7*sqrt(2))/3});
- \coordinate (C_1) at ({10*(-1+sqrt(2))/3},{2*(5+4*sqrt(2))/3});
- \coordinate (D_1) at ({-4+5*sqrt(2)/3},{2+7*sqrt(2)/3});
- \coordinate (B_h) at ({(2+5*sqrt(2))/3},{(-2+sqrt(2))/3});
- \coordinate (C_h) at ({10*sqrt(2)/3},{2*sqrt(2)/3});
- \coordinate (D_h) at ({(-2+5*sqrt(2))/3},{(2+sqrt(2))/3});
- \coordinate (A_{1h}) at ({-10/3},{-2/3});
- \coordinate (B_{1h}) at ({(-8+5*sqrt(2))/3},{(-4+sqrt(2))/3});
- \coordinate (C_{1h}) at ({10*(-1+sqrt(2))/3},{2*(-1+sqrt(2))/3});
- \coordinate (D_{1h}) at ({-4+5*sqrt(2)/3},{sqrt(2)/3});
- \tkzLabelPoints[below](A);
- \tkzLabelPoints[left](A_1);
- \tkzLabelPoints[right](B,C,D);
- \tkzLabelPoints[above left](B_1,C_1,D_1);
- \tkzDrawSegments(B,C A_1,B_1 B_1,C_1 C_1,D_1 D_1,A_1 B,B_1 C,C_1);
- \tkzDrawSegments[style=dashed](A,B A,D A,A_1 D,D_1 C,D);
- \tkzDrawSegments(B,B_h C,C_h A_1,A_{1h} B_1,B_{1h});
- \tkzDrawSegments[style=dashed](C_1,C_{1h} D,D_h D_1,D_{1h});
- \tkzDrawSegments[style=dashed](D_h,D_{1h} D_{1h},A_{1h} D_{1h},C_{1h} C_{1h},B_{1h} C_h,C_{1h} D_h,C_h);
- \tkzDrawSegments(B_{1h},A_{1h} B_{1h},B_h B_h,C_h);
- \end{tikzpicture}
复制代码 |