< canvas id = "drawing_canvas" ></ canvas > < style > #drawing_canvas { position : absolute ; margin : auto ; width : 1200px ; height : 750px ; top : 0 ; bottom : 0 ; left : 0 ; right : 0 ; } </ style > < script > const TWO_PI = Math . PI * 2 ; const HALF_PI = Math . PI * 0.5 ; // canvas settings var viewWidth = 1200 , viewHeight = 750 , drawingCanvas = document . getElementById ( "drawing_canvas" ), ctx , timeStep = ( 1 / 60 ); Point = function ( x , y ) { this . x = x || 0 ; this . y = y || 0 ; }; Particle = function ( p0 , p1 , p2 , p3 ) {