Skip to content

Commit 17d4e88

Browse files
authored
Update README.md
1 parent 497d57c commit 17d4e88

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

README.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
**C60分子结构**
3939

40-
![C60分子结构](pic/C60.gif "C60分子结构")
40+
![C60分子结构](pic/C60.gif "C60分子结构")
4141
<br/>
4242
<br/>
4343
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
@@ -65,7 +65,69 @@
6565

6666
**矢量场流线**
6767

68-
![矢量场流线](pic/线圈电流磁场.gif "矢量场流线")
68+
![矢量场流线](pic/线圈电流磁场.gif "矢量场流线")
69+
70+
'''
71+
public class SimpleVectorFieldDemo {
72+
public static void main(String[] args) {
73+
74+
VectorFieldProcessor processer = new VectorFieldProcessor();
75+
76+
Matplot3D4JMgr matPlot3DMgr = new Matplot3D4JMgr(processer);
77+
78+
Vector3D v1 = new Vector3D(1, 0, 0);
79+
Vector3D v2 = new Vector3D(-0.1, 0, 0);
80+
Vector3D vNull = new Vector3D(0, 0, 0);
81+
82+
class MyMapper1 implements Point3dVector3dMapper {
83+
public Vector3D f(Point3D p) {
84+
if (p.y() > 0) {
85+
return v1;
86+
} else {
87+
return vNull;
88+
}
89+
}
90+
91+
public void setAdditionalPrar(Object additionalprar) {}
92+
}
93+
94+
class MyMapper2 implements Point3dVector3dMapper {
95+
public Vector3D f(Point3D p) {
96+
if (p.y() < 0) {
97+
return v2;
98+
} else {
99+
return vNull;
100+
}
101+
}
102+
103+
public void setAdditionalPrar(Object additionalprar) {}
104+
}
105+
106+
processer.addData(new MyMapper1(), "1", Color.RED, new Range(-9, 9), new Range(-9, 9), new Range(-9, 9));
107+
108+
processer.addData(new MyMapper2(), "2", Color.BLUE, new Range(-9, 9), new Range(-9, 9), new Range(-9, 9));
109+
110+
List<Point3D> seeds = new ArrayList<Point3D>();
111+
112+
for (double z = -9; z <= 9; z += 1.2) {
113+
for (double y = -9; y <= 9; y += 1.2) {
114+
seeds.add(new Point3D(0, y, z));
115+
}
116+
}
117+
118+
processer.setPropertyToAll("seeds", seeds);
119+
processer.setPropertyToAll("alphaNoise", 0.0);
120+
121+
matPlot3DMgr.setTitle("矢量场流线");
122+
matPlot3DMgr.setAppearanceTheme(Matplot3D4JMgr.APPEARANCE_THEME_DARK);
123+
124+
matPlot3DMgr.setCoordianteSysShowType(Matplot3D4JMgr.COORDINATE_SYS_ALWAYS_FURTHER);
125+
126+
matPlot3DMgr.showMotion(-1, 15, 0);
127+
}
128+
}
129+
'''
130+
69131
<br/>
70132
<br/>
71133
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄

0 commit comments

Comments
 (0)