SwiftyTwoLinks and KotlyOtlyDobleDosLinks
ContentView.swiftdisplays the 3D visualization of the double pendulum, and includes user controlsContentViewController.swiftcontrols the objects used to render in SceneKit, and updates simulation at 1/60 second incrementsTwoLinks.swiftmodels the physical behavior of the double pendulumTextSlider.swiftimplements a slider control with a text label above it, with semi-transparent background
MainActivity.ktis the layout and scene manipulation featuresMainViewModel.ktcontrols resetting, pausing, or updating statesTwoLinks.ktmodels the physical behavior of the double pendulum
There are five normalized values that define dimensions of the two link pendulum system.
Each link has a length L, and a minimum distance d from its end where an attachment point can be defined.
Three points are defined, the hinge point H about which the link rotates, the link center point C, and a pivot point P about which a second link rotates.
The dimension x defines the distance from H to C, and the dimension y defines the distance from H to P.
The diagram below references these dimensions, and explains how they are calculated using normalized values that the user controls.
