when you create a Link object, you need to pass an id number and a two element array that defined the node indices of two ends. If you want to rigidly connect two different links (make them move together), you can set their group to the same value.

Final step in designing a mechanism is defining the joint types of the links:

where first input is the index of the link that will be driven, second parameter is the index of the degree of freedom of the link (individual links can have more than one degree of freedom) and the last parameter is the magnitude of the input. Multiple inputs can be added if the mechanism has multiple free degrees of freedom.

Finally, kinematic analysis can be performed on the mechanism with the given inputs:

boolean successful=kinematics.solve();

solve() method will return true if kinematic analysis is successful.

You can print new coordinates of the nodes after the kinematic analysis: