Julia 3D绘图:如何在坐标之间绘制直线?
我正在做一个朋友在茱莉亚写的节目。我们必须为大学做一些工作,特别是一门叫做“动态建模”的课程 事情是复制一些伟大的作品卡什坦和阿隆;也许你知道他们关于生物网络和遗传算法的出版物。现在我的朋友问我,我们是否可以用3D绘制一些东西,我不知道怎么做。他给了我我们程序的一部分(见下面的代码),写信给我想知道我们是否可以从一个坐标(x,y,z)到另一个坐标(x,y,z)画一条线。你知道朱莉娅该怎么做吗Julia 3D绘图:如何在坐标之间绘制直线?,julia,Julia,我正在做一个朋友在茱莉亚写的节目。我们必须为大学做一些工作,特别是一门叫做“动态建模”的课程 事情是复制一些伟大的作品卡什坦和阿隆;也许你知道他们关于生物网络和遗传算法的出版物。现在我的朋友问我,我们是否可以用3D绘制一些东西,我不知道怎么做。他给了我我们程序的一部分(见下面的代码),写信给我想知道我们是否可以从一个坐标(x,y,z)到另一个坐标(x,y,z)画一条线。你知道朱莉娅该怎么做吗 module ShowGateNet export showGate, setGat
module ShowGateNet
export
showGate,
setGattaStruct;
using Plots;
using BPIPopulation;
abstract GrafGate
type GGate <: GrafGate
in1::Array{Integer};
in2::Array{Integer};
out::Array{Integer};
end;
#---------------------------------------------------------------
# creates a 2D-matrix for almost a circle:
# mx:: x-coordinate of the center circle
# my:: y-coordinate of the center circle
# r:: radius of the circle
#---------------------------------------------------------------
function circNumba(rx=2::Integer,cx=0::Integer,cy=0::Integer, cz=0)
k=0:360;
c=zeros(length(k),4);
c[:,1] = k;
c[:,2] = round(cos(radian(k))*rx+cx,3);
c[:,3] = cy;
c[:,4] = round(sin(radian(k))*rx+cz,3);
return c;
end;
function radian(grad)
return round(2*pi*grad/360,3);
end
function showGate(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]-3;centr[2]+1;centr[3]-1];
in1 = [centr[1]+3;centr[2]-1;centr[3]-1];
K = [centr[1];centr[2];centr[3]-1];
O = [centr[1];centr[2];centr[3]-3];
kCirc = circNumba(r,K[1],K[2],K[3]);
#display(plot!(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red",zlabel="Z",xlabel="X",ylabel="Y"));
#display(plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue"));
#display(plot!([centr[1]-3,centr[1]-3,centr[1]-2],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green")); #A nach K
#display(plot!([centr[1]+2,centr[1]+2,centr[1]+3],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green")); #A nach K
display(plot(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red",zlabel="Z",xlabel="X",ylabel="Y"));
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue");#senkrechte
plot!([centr[1]-3,centr[1]-3,centr[1]-2],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plot!([centr[1]+2,centr[1]+2,centr[1]+3],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plotNumba(K,numba);
end;
function showGate2(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]+1;centr[2]+1;centr[3]];
in1 = [centr[1]+1;centr[2]-1;centr[3]];
K = [centr[1];centr[2]-r*2;centr[3]-1];
O = [centr[1];centr[2];centr[3]-1];
kCirc = circNumba(r,K[1],K[2],K[3]);
display(plot(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red",zlabel="Z",xlabel="X",ylabel="Y"));
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue");
plotNumba(K,numba);
end;
function showGate2!(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]+1;centr[2]+1;centr[3]];
in1 = [centr[1]+1;centr[2]-1;centr[3]];
K = [centr[1];centr[2];centr[3]-1];
O = [centr[1];centr[2];centr[3]-1];
kCirc = circNumba(r,K[1],K[2],K[3]);
plot!(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red",zlabel="Z",xlabel="X",ylabel="Y");
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue");
plot!([centr[1]-3,centr[1]-3,centr[1]-2],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plot!([centr[1]+2,centr[1]+2,centr[1]+3],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plotNumba(K,numba);
end;
function showGateIn!(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]+1;centr[2]+1;centr[3]];
in1 = [centr[1]+1;centr[2]-1;centr[3]];
K = [centr[1];centr[2];centr[3]-1];
O = [centr[1];centr[2];centr[3]-1];
kCirc = circNumba(r,K[1],K[2],K[3]);
plot!(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red",zlabel="Z",xlabel="X",ylabel="Y");
if numba == 1
display(plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue"));
else
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1-r,centr[3]-1-r,centr[3]-3-r],w=3,color="blue");
end;
plotNumba(K,numba);
end;
function showGateL!(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]+1;centr[2]+1;centr[3]];
in1 = [centr[1]+1;centr[2]-1;centr[3]];
K = [centr[1]-1-r;centr[2];centr[3]-1];
O = [centr[1];centr[2];centr[3]-1];
kCirc = circNumba(r,K[1],K[2],K[3]);
plot!(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red");
plot!([centr[1]-1,centr[1]-1,centr[1]],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plot!([centr[1],centr[1],centr[1]+1],[centr[2],centr[2],centr[2]]+0.5,[centr[3]-1,centr[3]-1,centr[3]-1],w=3,color="green");# B nach D
plot!([centr[1],centr[1],centr[1]+1],[centr[2],centr[2],centr[2]]-0.5,[centr[3],centr[3],centr[3]]-1,w=3,color="green");# C nach E
plot!([centr[1],centr[1],centr[1]],[centr[2]-0.5,centr[2]-0.5,centr[2]+0.5],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); # C nach B (waagerechte
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1,centr[3]-1,centr[3]-3],w=3,color="blue");
plotNumba(K,numba);
end;
function showGateR!(cx,cy,cz,numba)
r = 2;
centr = [cx;cy;cz];
# A = [centr[1]-1;centr[2];centr[3]];
# B = [centr[1];centr[2]+1;centr[3]];
C = [centr[1];centr[2]-1;centr[3]];
in2 = [centr[1]+1;centr[2]+1;centr[3]];
in1 = [centr[1]+1;centr[2]-1;centr[3]];
K = [centr[1]+1+r;centr[2];centr[3]-1];
O = [centr[1];centr[2];centr[3]-1];
kCirc = circNumba(r,K[1],K[2],K[3]);
plot!(kCirc[:,2],kCirc[:,3],kCirc[:,4],title="test-circ",line=3,color="red");
plot!([centr[1]+1,centr[1]+1,centr[1]],[centr[2],centr[2],centr[2]],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); #A nach K
plot!([centr[1],centr[1],centr[1]-1],[centr[2],centr[2],centr[2]]+0.5,[centr[3]-1,centr[3]-1,centr[3]-1],w=3,color="green");# B nach D
plot!([centr[1],centr[1],centr[1]-1],[centr[2],centr[2],centr[2]]-0.5,[centr[3],centr[3],centr[3]]-1,w=3,color="green");# C nach E
plot!([centr[1],centr[1],centr[1]],[centr[2]-0.5,centr[2]-0.5,centr[2]+0.5],[centr[3],centr[3],centr[3]]-1,w=3,color="green"); # C nach B (waagerechte
plot!([centr[1],centr[1],centr[1]],[centr[2],centr[2],centr[2]],[centr[3]-1,centr[3]-1,centr[3]-3],w=3,color="blue");
plotNumba(K,numba);
end;
#function setGattaStruct(pEle::BPIPopulation.popElement)
function setGattaStruct()
showGate(0,0,-4,15); # 15
showGate2!(-4,0,8,14); #14
showGate2!(4,0,8,13); #13
showGateL!(-8,4,16,12); #12
showGateL!(-8,-4,16,11); #11
showGateR!(8,4,16,10); #10
showGateR!(8,-4,16,9); #9
showGateL!(-8,4, 32,8); #8
showGateL!(-8,-4, 32,7); #7
showGateR!(8,4, 32,6); #6
showGateR!(8,-4, 32,5); #5
showGateIn!(0,6, 40,4); #4
showGateIn!(0,2, 40,3); #3
showGateIn!(0,-2, 40,2); #2
showGateIn!(0,-6, 40,1); #1
# hier dann evtl "PLOTTEN "der verbindungen
end;
function plotNumba(K,numba)
if numba>=10
plot!([K[1],K[1],K[1]]-0.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
end;
if numba%10 == 0
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 1
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
end;
if numba%10 == 2
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],
[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 3
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 4
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color="blue");
end;
if numba%10 == 5
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 6
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 7
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 8
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
if numba%10 == 9
plot!([K[1],K[1],K[1]]+0.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color="blue");
plot!([K[1],K[1],K[1]]+1.25,[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]-1,w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color="blue");
plot!([K[1]+1,K[1]+1,K[1]]+0.25,[K[2],K[2],K[2]],[K[3],K[3],K[3]]+1,w=3,color="blue");
end;
end;
end; # END MODULE
模块ShowGateNet
出口
展示门,
setGattaStruct;
使用绘图;
使用BPI填充;
抽象格拉夫盖特
GGate型=10
情节([K[1],K[1],K[1]]-0.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“blue”);
结束;
如果numba%10==0
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“blue”);
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color=“blue”);
结束;
如果numba%10==1
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“blue”);
结束;
如果numba%10==2
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],
[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color=“blue”);
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]],w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color=“blue”);
结束;
如果numba%10==3
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],
[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]-1,w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]],w=3,color=“blue”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],
[K[3],K[3],K[3]]+1,w=3,color=“blue”);
结束;
如果numba%10==4
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color=“蓝色”);
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color=“蓝色”);
结束;
如果numba%10==5
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25,[K[2],K[2],K[2]],[K[3],K[3]-1,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25[K[2],K[2],K[2]],[K[3],K[3]+1,w=3,color=“蓝色”);
结束;
如果numba%10==6
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-2,K[3]-2,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25,[K[2],K[2],K[2]],[K[3],K[3]-1,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25[K[2],K[2],K[2]],[K[3],K[3]+1,w=3,color=“蓝色”);
结束;
如果numba%10==7
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25[K[2],K[2],K[2]],[K[3],K[3]+1,w=3,color=“蓝色”);
结束;
如果numba%10==8
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25,[K[2],K[2],K[2]],[K[3],K[3]-1,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25[K[2],K[2],K[2]],[K[3],K[3]+1,w=3,color=“蓝色”);
结束;
如果numba%10==9
情节([K[1],K[1],K[1]]+0.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-2]+2,w=3,color=“蓝色”);
情节([K[1],K[1],K[1]]+1.25[K[2],K[2],K[2]],[K[3]-1,K[3]-1,K[3]-3]+2,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25,[K[2],K[2],K[2]],[K[3],K[3]-1,w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]]+0.25[K[2],K[2],K[2]],[K[3],K[3],K[3]],w=3,color=“蓝色”);
情节([K[1]+1,K[1]+1,K[1]+0.25[K[2],K[2],K[2]],[K[3],K[3]+1,w=3,color=“蓝色”);
结束;
结束;
完!端模块
请阅读-总结是,这不是向志愿者讲话的理想方式,可能会对获得答案产生反作用。请不要把这个添加到你的问题中。从一个3D点到另一个3D点似乎有很多方法。你看过报纸了吗?你尝试过什么?以目前的形式,这个问题不太可能吸引到答案。我建议将其改写为这样的内容:“使用Plots软件包,我如何在三维绘图中的两个坐标之间画一条线?以下是我迄今为止所做的尝试:这里的代码演示了在环境中解决问题的认真尝试”。使用Plots;绘图((x,y,z),(x2,y2,z2))