Last updated March 02, 2010 15:35, by raindrop
Contents
- 1 JavaFX MultiDimensional Library Wiki
- 1.1 Fractals
- 1.2 Shapes
- 1.3 Multidimensional Shapes
- 1.4 Equations
- 1.5 Matrix
- 1.6 Graph
- 1.7 Electronic Simulator
JavaFX MultiDimensional Library Wiki
Fractals
Stage {
title: "Snowflake"
scene: Scene {
width: 400
height: 400
content: SnowFlake {
depth: 6
centerX: 200
centerY: 200
radius: 150
}
}
}
Shapes
Multidimensional Shapes
Equations
import mathematics.equation.*;
var equationSystem = LinearEquationSystem{
equations: [
LinearEquation{ coefficients: [ 3, 4 ] solution: 2 }
LinearEquation{ coefficients: [ 1, 3 ] solution: -1 }
]
}
equationSystem.solve();
println(equationSystem);
Matrix
var squareMatrix = MDSquareMatrix{
dim: 2
elems: [
[ 1, 2 ],
[ 3, 4 ],
]
}
println(squareMatrix);
println("det: {squareMatrix.determinant()}");
Result:
Square Matrix{ dim: 2 elems: [ 1.0 2.0 ][ 3.0 4.0 ] }
det: -2.0
Graph
import mathematics.graph.*;
import javafx.stage.Stage;
import javafx.scene.Scene;
var graph = Graph{
order: 5
connections: [
Connection{ vertex1: 0 vertex2: 1 }
Connection{ vertex1: 0 vertex2: 2 }
Connection{ vertex1: 0 vertex2: 3 }
Connection{ vertex1: 1 vertex2: 2 }
Connection{ vertex1: 3 vertex2: 4 }
]
};
var shortestPath:Edge[];
Stage {
title : "Graph"
scene: Scene {
width: 300
height: 300
content: [
GraphView{
translateX: 150
translateY: 150
graph: graph
selectedEdges: bind shortestPath
onSelectionChanged:function(source:Vertex, destination:Vertex){
shortestPath = GraphAlgorithm.dijkstraShortestPath(source, destination, graph);
}
}
]
}
}
Electronic Simulator
import javafx.scene.Scene;
import javafx.stage.Stage;
import physics.electronic.*;
Stage {
title: "Simple Electro Simulator"
width: 300
height: 200
scene: Scene{
content: ElectroScheme{
var wire1 = Wire{}
var wire2 = Wire{}
var wire3 = Wire{}
wires: [ wire1, wire2, wire3 ]
components:[
Lamp{
pos: XY{ x: 160 y: 25}
pin1: wire1.pin2
pin2: wire3.pin1
},
Battery{
pos: XY{ x: 100 y: 120}
pin1: wire2.pin2
pin2: wire1.pin1
},
Switch{
pos: XY{ x: 180 y: 105}
pin1: wire3.pin2
pin2: wire2.pin1
}
]
}
}
}






