coupling-function.js

total 0
used 0
limit 0
/* --- title: Coupling Function categories: binding files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/point-content.js ../point_src/pointlist.js ../point_src/point.js ../point_src/events.js ../point_src/automouse.js ../point_src/distances.js ../point_src/dragging.js ../point_src/functions/clamp.js ../point_src/stage.js ../point_src/coupling.js --- In this example. The node A and B locked _rotation_ to the location of C. a.rotation -> [coupled to] -> b.location a.rotation <- [coupled to] <- b.location */ class MainStage extends Stage { canvas='playspace' mounted(){ let a = this.a = new Point({x:200,y:200, radius: 50}) let looky = this.c = new Point({x:400,y:200, radius: 10}) this.dragging.add(a, looky) // The looky point should _loosely_ follow A. // looky should follow A, // and looky should release when manipulated // e.g. A drag control point } draw(ctx){ this.clear(ctx) this.a.pen.indicator(ctx, { color:'#ddd'}) this.c.pen.indicator(ctx) } } ;stage = MainStage.go();
Run
Meta Data
title Coupling Function
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/point-content.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../point_src/dragging.js', '../point_src/functions/clamp.js', '../point_src/stage.js', '../point_src/coupling.js')
unused_keys ()
unknown_keys ('categories',)
categories ['binding']
filepath_exists True
path coupling-function.js
filepath coupling-function.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/functions/clamp.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/coupling.js')
markdown {'html': '<p>In this example. The node A and B locked <em>rotation</em> to the location of C.</p>\n<pre><code>a.rotation -&gt; [coupled to] -&gt; b.location\na.rotation &lt;- [coupled to] &lt;- b.location\n</code></pre>', 'content': '---\ntitle: Coupling Function\ncategories: binding\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/point-content.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/distances.js\n ../point_src/dragging.js\n ../point_src/functions/clamp.js\n ../point_src/stage.js\n ../point_src/coupling.js\n---\n\nIn this example. The node A and B locked _rotation_ to the location of C.\n\n a.rotation -> [coupled to] -> b.location\n a.rotation <- [coupled to] <- b.location'}