Last updated March 02, 2010 15:35, by raindrop


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
                }
            ]
        }
    }
}


  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20100312.9442df5)
 
 
loading
Please Confirm