|
37 | 37 |
|
38 | 38 | **C60分子结构**
|
39 | 39 |
|
40 |
| - |
| 40 | + |
41 | 41 | <br/>
|
42 | 42 | <br/>
|
43 | 43 |  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
|
|
65 | 65 |
|
66 | 66 | **矢量场流线**
|
67 | 67 |
|
68 |
| - |
| 68 | + |
| 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 | + |
69 | 131 | <br/>
|
70 | 132 | <br/>
|
71 | 133 |  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
|
|
0 commit comments